mirror of
https://github.com/openfoodfoundation/openfoodnetwork
synced 2026-01-24 20:36:49 +00:00
Tweaking the bulk order management spec again
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user