Branch: refs/heads/master
Home: http://github.com/reddragon/fsoc
Commit: b53971363ca95a670e1507730fa5119bd4f34279
http://github.com/reddragon/fsoc/commit/b53971363ca95a670e1507730fa5119bd4f…
Author: Gaurav Menghani <gaurav.menghani(a)gmail.com>
Date: 2010-07-27 (Tue, 27 Jul 2010)
Changed paths:
M app/models/proposal.rb
M config/environment.rb
A test/factories.rb
M test/fixtures/comments.yml
M test/fixtures/projects.yml
M test/fixtures/tasks.yml
M test/fixtures/users.yml
M test/unit/comment_test.rb
A test/unit/journal_test.rb
M test/unit/project_test.rb
M test/unit/proposal_test.rb
M test/unit/task_test.rb
Log Message:
-----------
Unit tests & Fixed bug while creating proposal
Hi,
My apologies for not being able to be regular this week. I should get a
stable net connection in a couple of days.
I have written one informal and illustrated guide [0] to FSoC. It gives an
idea to the reader on how to set up and use FSoC.
Also, since the documentation is now ready and all the features implemented,
I feel it is the right time to open up FSoC to community testing and getting
their feedback. [1]
[0] http://fsocblog.wordpress.com/2010/07/25/fsoc-setup-walkthrough/
[1] http://fsocblog.wordpress.com/2010/07/25/community-testing/
Warm Regards,
--
Gaurav Menghani
Hi,
For the past one week I have been experiencing delays in several aspects.
The repository issue has been temporarily addressed by keeping the
repository address in the database, but not fetching updates. The issues
pointed out by Shakthi in [0] currently make it look ineffective to link
with any single repository hosting system or even one single CVS for that
matter. I spent yesterday hacking with restful_authentication trying to
resolve the other issue, but it still does not work. Since all core features
have been implemented and the delays are falling in the buffer period set
aside, they have not hampered the progress.
I had written unit tests for models earlier (not yet committed), and will
use them with factory_girl instead of fixtures. Amongst the agendas for the
coming week is to render XML apart from HTML and writing a concise
documentation on how to test out the project features (for usability tests
by the community).
Currently, I am having very limited internet connectivity in the past couple
of days. Please excuse this, I would keep committing as regularly possible.
[0] https://fedorahosted.org/pipermail/fsoc/2010-July/000040.html
Warm Regards,
--
Gaurav Menghani
Hi,
--- On Sun, Jul 11, 2010 at 9:27 AM, Shakthi Kannan <shakthimaan(a)gmail.com>
| wrote:
|
| Gaurav:
|
| Use factory_girl?
|
| http://github.com/thoughtbot/factory_girl
\--
Just to add to the above, after installing the factory_girl gem,
create a directory test/factories in the project sources. For each
model, create a file <model>.rb. For example:
=== test/factories/event.rb ===
Factory.define :event do |u|
u.name 'Testing'
u.start_at '2010-07-25 00:00:00'
u.end_at '2010-07-29 00:00:00'
u.created_at '2010-07-16 00:00:00'
u.updated_at '2010-07-16 00:00:00'
end
=== END ===
In your unit tests, you can create an event object using:
event = Factory.build(:event)
If you want to override any attributes of the event object, you can
pass it as a parameter:
event = Factory.build(:event, :name => 'Migration')
For every code, constraint that you put in the model, you should have
a test case that addresses it. When you modify any model code in
future, you will need to re-run the test cases to make sure you didn't
break anything. In future, as you write code, make sure you have a
test case for it.
The test cases are also helpful when you move into normalizing, or
optimize or re-factoring your code, as you can re-run the test cases
to make sure your changes haven't modified any logic.
SK
--
Shakthi Kannan
http://www.shakthimaan.com
Branch: refs/heads/master
Home: http://github.com/reddragon/fsoc
Commit: fdb314a790d652087c968b80d02e93044125323a
http://github.com/reddragon/fsoc/commit/fdb314a790d652087c968b80d02e9304412…
Author: Gaurav Menghani <gaurav.menghani(a)gmail.com>
Date: 2010-07-13 (Tue, 13 Jul 2010)
Changed paths:
M app/controllers/projects_controller.rb
M app/controllers/proposals_controller.rb
M app/models/proposal.rb
M app/views/projects/show.html.erb
A app/views/proposals/code_repository.html.haml
M app/views/proposals/show.html.erb
M config/app_settings.yml
M config/routes.rb
M db/migrate/20100426095338_create_proposals.rb
M db/schema.rb
M lib/access_control.rb
A vendor/plugins/validates_url_format_of/README.markdown
A vendor/plugins/validates_url_format_of/init.rb
A vendor/plugins/validates_url_format_of/test/validates_url_format_of_test.rb
Log Message:
-----------
Adding a Repository
Hi,
Hooking up with a code repository is a deliverable. I was doing some
research regarding the same while trying to fix the logout issue in the
tests, about which I talked in the last mail.The system should associate
each accepted proposal with a code repository, and periodically notify the
mentor when a commit is made, and put up some commit info on the 'Code
Repository' section in the Project.
The plan was to keep the URL of the .git files, use an appropriate git
command periodically to find the commit info remotely, then notify the
mentor when a new commit is made, and put that information on the Code
Repository page. Though the 'git log' command does well to print the log of
a local git repository, I could not find a way to get the logs of a remote
repository without cloning it on the local machine, or ssh-ing into the
server machine, both of which are not suitable. If you know of a way to do
this, please let me know.
Currently as a temporary alternative I have written a script that can be run
as a cron job periodically to fetch commit info from github repositories
using the github API [0]. Though this is an easy alternative, but it would
be great if the previous issue can be resolved.
[0] http://gist.github.com/464283
Warm Regards,
--
Gaurav Menghani
Hi,
I was writing functional tests for the application. Since, most of the pages
require a login, the login_as method is being used to fake the login [1].
The application makes use of the RESTful Authentication plugin for
authentication.
However, since there are three types of users and each with different level
of access rights, I wanted the tests to be run for each type of users with
appropriate responses being expected and verified. Thus, requiring login and
logout every time the test is to be run for a particular user. However, once
login_as is used, I am not able to use login_as for some other user in the
test. [0] and users.yml at [3]. What I mean to say is the session persists
and I am not able to destroy it.
This is what I tried:
1. Simply try calling login_as again. This would over-write the session.
2. Do @request[session_id] = nil explicitly before trying a new user.
3. Call logout_killing_session [2]. But this throws a no method error for
'reset_session'
3.1 Tried including the Authentication, Authorization and Trustification
modules, but the issue still remains.
4. Made a logout method in authenticated_test_helper.rb which does
@request[session_id] = nil
If you know, please let me know how I could fix this.
[0] http://pastie.org/1039110
[1]
http://github.com/reddragon/fsoc/blob/master/lib/authenticated_test_helper.…
[2]
http://github.com/reddragon/fsoc/blob/master/lib/authenticated_system.rb#L1…
[3] http://pastie.org/1039122
Warm Regards,
--
Gaurav Menghani
Hi,
1. Instead of having "task" and "comment" as two different models, one
should be able to add comments for each task, so the history of the
discussion for the task can be archived for reference.
I'd suggest having a look at "Issues" of redmine [1] for the
functionality that I am looking at. You could rename it as "task" in
your context. I also suggest you have a look at the plugins used by
redmine:
http://www.redmine.org/wiki/redmine/Plugin_List
It probably contains things that you already need.
2. When one proposes a project/task there is an option to list the
time required to complete it. IMO, this must be agreed upon between
the mentor and student assigned to the task.
Using "aasm" [2] each task must move from one state to another: NEW,
ASSIGNED, ACCEPTED, CLOSED, INVALID etc.
Regards,
SK
[1] Redmine. http://www.redmine.org/
[2] Acts As State Machine. http://github.com/rubyist/aasm
--
Shakthi Kannan
http://www.shakthimaan.com