Am 07.11.2011 um 21:58 schrieb Dave Aronson:
> On Mon, Nov 7, 2011 at 15:49, Gregor Panek <[email protected]> wrote:
>
>> describe "GET 'show'" do
>> it "returns http success" do
>> get 'show'
>> response.should be_success
>> end
>
> Don't you need to specify an id there? Or are you thinking "index"
> (show *all*)?
>
> -Dave
>
> --
> LOOKING FOR WORK! What: Ruby (on/off Rails), Python, other modern languages.
> Where: Northern Virginia, Washington DC (near Orange Line), and remote work.
> See: davearonson.com (main) * codosaur.us (code) * dare2xl.com (excellence).
> Specialization is for insects. (Heinlein) - Have Pun, Will Babble! (Aronson)
>
How to do that? I just started to learn how write tests for the application.
describe "GET 'show'" do
it "returns http success" do
get 'show/1'
response.should be_success
end
OR can i use a wildcard?
describe "GET 'show'" do
it "returns http success" do
get 'show/:id'
response.should be_success
end
What makes me pondering is that rake routes is shows that the route is
available so how can the id be the problem that the test fails?! Sorry if this
question is stupid but I'm still in the learning stage
users GET /users(.:format) {:action=>"index",
:controller=>"users"}
POST /users(.:format)
{:action=>"create", :controller=>"users"}
new_user GET /users/new(.:format)
{:action=>"new", :controller=>"users"}
edit_user GET /users/:id/edit(.:format)
{:action=>"edit", :controller=>"users"}
user GET /users/:id(.:format)
{:action=>"show", :controller=>"users"}
PUT /users/:id(.:format)
{:action=>"update", :controller=>"users"}
DELETE /users/:id(.:format)
{:action=>"destroy", :controller=>"users"}
--
You received this message because you are subscribed to the Google Groups "Ruby
on Rails: Talk" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/rubyonrails-talk?hl=en.