diff --git a/spec/support/feature_toggle_helper.rb b/spec/support/feature_toggle_helper.rb index 7471103e4f..6d9e1fadf5 100644 --- a/spec/support/feature_toggle_helper.rb +++ b/spec/support/feature_toggle_helper.rb @@ -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 diff --git a/spec/support/request/authentication_workflow.rb b/spec/support/request/authentication_workflow.rb index 7645db0012..7806676781 100644 --- a/spec/support/request/authentication_workflow.rb +++ b/spec/support/request/authentication_workflow.rb @@ -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 diff --git a/spec/support/request/ui_component_helper.rb b/spec/support/request/ui_component_helper.rb index 27f5cdae0a..cc304a9364 100644 --- a/spec/support/request/ui_component_helper.rb +++ b/spec/support/request/ui_component_helper.rb @@ -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 diff --git a/spec/support/request/web_helper.rb b/spec/support/request/web_helper.rb index 52ffc306ac..837483544f 100644 --- a/spec/support/request/web_helper.rb +++ b/spec/support/request/web_helper.rb @@ -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