Tweaking the bulk order management spec again

This commit is contained in:
Will Marshall
2014-05-02 12:41:04 +10:00
parent 8c319334db
commit 705e247eb8
2 changed files with 11 additions and 3 deletions

View File

@@ -8,8 +8,7 @@ feature %q{
include AuthorizationHelpers
include WebHelper
before(:all) { Spree::Ability.register_ability(AuthorizationHelpers::Request::SuperAbility) }
after(:all) { Spree::Ability.remove_ability(AuthorizationHelpers::Request::SuperAbility) }
stub_authorization!
before :all do
@default_wait_time = Capybara.default_wait_time
@@ -36,6 +35,7 @@ feature %q{
it "displays a message when number of line items is zero" do
visit '/admin/orders/bulk_management'
page.should have_text "No matching line items found."
end
context "displaying the list of line items" do

View File

@@ -1,5 +1,4 @@
module AuthenticationWorkflow
def quick_login_as(user)
ApplicationController.any_instance.stub(:spree_current_user).and_return user
ApplicationController.any_instance.stub(:current_api_user).and_return user
@@ -19,6 +18,11 @@ module AuthenticationWorkflow
admin_user
end
def stub_authorization!
before(:all) { Spree::Ability.register_ability(AuthorizationHelpers::Request::SuperAbility) }
after(:all) { Spree::Ability.remove_ability(AuthorizationHelpers::Request::SuperAbility) }
end
def login_to_admin_section
admin_role = Spree::Role.find_or_create_by_name!('admin')
admin_user = create(:user,
@@ -70,3 +74,7 @@ module AuthenticationWorkflow
click_button 'Login'
end
end
RSpec.configure do |config|
config.extend AuthenticationWorkflow, :type => :feature
end