From 638d6d2ac0238e54d7dd421822a561dd563fb650 Mon Sep 17 00:00:00 2001 From: Will Marshall Date: Fri, 30 May 2014 12:58:58 +1000 Subject: [PATCH] Moving around the authentication specs --- spec/features/admin/authentication_spec.rb | 17 +++++++++++++++++ spec/features/consumer/authentication_spec.rb | 9 --------- 2 files changed, 17 insertions(+), 9 deletions(-) create mode 100644 spec/features/admin/authentication_spec.rb diff --git a/spec/features/admin/authentication_spec.rb b/spec/features/admin/authentication_spec.rb new file mode 100644 index 0000000000..6dd62bdc73 --- /dev/null +++ b/spec/features/admin/authentication_spec.rb @@ -0,0 +1,17 @@ +require 'spec_helper' + +feature "Authentication", js: true do + include UIComponentHelper + describe "logging into admin" do + let(:user) { create(:user, password: "password", password_confirmation: "password") } + end + + scenario "logging into admin redirects home, then back to admin" do + visit spree.admin_path + fill_in "Email", with: user.email + fill_in "Password", with: user.password + click_login_button + page.should have_content "Dashboard" + current_path.should == spree.admin_path + end +end diff --git a/spec/features/consumer/authentication_spec.rb b/spec/features/consumer/authentication_spec.rb index 76e4a20877..8853a07c3d 100644 --- a/spec/features/consumer/authentication_spec.rb +++ b/spec/features/consumer/authentication_spec.rb @@ -14,15 +14,6 @@ feature "Authentication", js: true do page.should have_content "Select a producer from the list below" current_path.should == producers_path end - - scenario "logging into admin redirects home, then back to admin" do - visit spree.admin_path - fill_in "Email", with: user.email - fill_in "Password", with: user.password - click_login_button - page.should have_content "Dashboard" - current_path.should == spree.admin_path - end end describe "Loggin in from the home page" do