I just read that Capybara does not do integration testing ... this I
found right at the bottom of the Capybara documentation page. So since
all Capybara tests reside in the spec/features folder, I moved the

                     submitting a PUT request to the Employees#update

test into the spec/request folder and it passes.

Some progress .. now for the other two failing tests ... namely the:

              undefined local variable or method 'cookies'

Some more research of maybe someone has an understanding of why this
test is failing and is willing to give me some guidance?

Thanks.

On Jan 15, 5:09 pm, fuzzy <hlog...@gmail.com> wrote:
> Hi,
>
> rails 3.2.11 and Capybara 2.0.2 and the latest rspec.
>
> I have another test that has me searching for a solution ... just now, I do
> not have one and I have spent a number of days trying out different
> solutions.
>
> If I may ... here is the test, spec/features:
>
>            describe "submitting a PUT request to the Employees#update
> action" do
>               before { put employee_path(employee) }
>               specify { response.should redirect_to(signin_path) }
>             end
>
> It fails with this message:
>
>              NoMethodErrror: undefined method 'put'
>
> In this same group, I have another two tests failing both with:
>
>             undefined local variable or method 'cookies'
>
> and it identifies the sign_in def as the culprit:
>
>            def sign_in(employee)
>                visit signin_path
>                   fill_in "Email", with: employee.email
>                   fill_in "Password", with: employee.password
>                   click_button "Sign in"
>                   # Sign in when not using Capybara.
>                   cookies[:remember_token] = employee.remember_token
>              end
>
> This is part of the spec/support/utilities file.
>
> Does anyone have any ideas on how to solve this?
>
> Thanks.

-- 
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 rubyonrails-talk@googlegroups.com.
To unsubscribe from this group, send email to 
rubyonrails-talk+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


Reply via email to