mirror of
https://github.com/openfoodfoundation/openfoodnetwork
synced 2026-01-24 20:36:49 +00:00
Run transpec for spec/support
This commit is contained in:
@@ -3,7 +3,7 @@ module OpenFoodNetwork
|
||||
def set_feature_toggle(feature, status)
|
||||
features = OpenFoodNetwork::FeatureToggle.features
|
||||
features[feature] = status
|
||||
OpenFoodNetwork::FeatureToggle.stub(:features) { features }
|
||||
allow(OpenFoodNetwork::FeatureToggle).to receive(:features) { features }
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
@@ -66,4 +66,15 @@ end
|
||||
|
||||
RSpec.configure do |config|
|
||||
config.extend AuthenticationWorkflow, :type => :feature
|
||||
|
||||
# rspec-rails 3 will no longer automatically infer an example group's spec type
|
||||
# from the file location. You can explicitly opt-in to the feature using this
|
||||
# config option.
|
||||
# To explicitly tag specs without using automatic inference, set the `:type`
|
||||
# metadata manually:
|
||||
#
|
||||
# describe ThingsController, :type => :controller do
|
||||
# # Equivalent to being in spec/controllers
|
||||
# end
|
||||
config.infer_spec_type_from_file_location!
|
||||
end
|
||||
|
||||
@@ -50,7 +50,7 @@ module UIComponentHelper
|
||||
|
||||
def modal_should_be_open_for(object)
|
||||
within ".reveal-modal" do
|
||||
page.should have_content object.name
|
||||
expect(page).to have_content object.name
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
@@ -21,7 +21,7 @@ module WebHelper
|
||||
selector += "[placeholder='#{opts[:placeholder]}']" if opts.key? :placeholder
|
||||
|
||||
element = page.all(selector).first
|
||||
element.value.should == opts[:with] if element && opts.key?(:with)
|
||||
expect(element.value).to eq(opts[:with]) if element && opts.key?(:with)
|
||||
|
||||
have_selector selector
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user