spec/featrues/nyauth/sessions_spec.rb in nyauth-0.2.8 vs spec/featrues/nyauth/sessions_spec.rb in nyauth-0.3.0
- old
+ new
@@ -17,10 +17,22 @@
scenario "can't sign in user" do
click_button('Sign in')
expect(page).to have_content('Invalid')
end
+ end
+ feature 'sign in & redirect to page accessed before sign in' do
+ background { visit posts_path }
+
+ scenario 'sign in user' do
+ fill_in('session_service_email', with: user.email)
+ fill_in('session_service_password', with: user.password)
+ click_button('Sign in')
+
+ expect(page).to have_content('sign in success')
+ expect(current_path).to eq posts_path
+ end
end
feature 'sign out' do
background do
sign_in(user)