On Thursday, June 25, 2015 at 10:24:10 AM UTC+3, Jason Hsu, Rubyist wrote:
> The code in question is at
> https://github.com/jhsu802701/generic_app_template/blob/master/test/integration/admins_view_test.rb
> .
>
> I've used the Devise gem to create users and admins. I've successfully made
> the admin index page visible ONLY to admins, but it's failing the tests
> (Capybara and minitest). For some reason, executing the "visit" command
> kills the session. WHY? What should I be doing about this?
>
What do you mean by "kills the session". What happens? How does the test fail?
Fred
> The source code is:
>
> login_admin('[email protected]', 'Harvard Law', false)
>
>
>
> # View admin index
>
>
>
> admin_path = root_path + '/admins'
>
>
>
> click_on 'Profile'
>
>
>
>
>
>
>
>
>
> visit admin_path # NOTE: using the 'visit' command loses the
> session
>
>
>
>
>
>
>
>
>
> @a1.reload
>
>
>
> #assert_equal current_path, '/admins'
>
>
>
> assert_text 'Vivian'
>
>
>
> assert_text 'Kensington'
>
>
>
> assert_text 'Elle'
>
>
>
> assert_text 'Woods'
--
You received this message because you are subscribed to the Google Groups "Ruby
on Rails: Talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/rubyonrails-talk/5bb7843a-00f5-472d-b315-1e66681c2c05%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.