Topic: testing url parameters
I am very new to rails and am having a hard time writing unit tests.
How do I write rspec tests for accepting url parameters?
Basically I get a url like the following:
localhost:3000/groups/?group_id=2
In my controller I asssign it to a variable.
@group_id = params[:group_id]
In my view I am just comparing the group id with the id retrieved from the database
.accordion-body{id: "collapse-#{index}", class: ( @group_id.to_i == group.id || ) ? '' : 'collapse' }
I am not sure how I would go about writing tests for this.
Last edited by ruby_begins (2013-03-05 15:39:08)