A few updates to spec where 'be true' and 'be false' didn't cut it

This commit is contained in:
Rob Harrington
2017-02-22 19:03:04 +11:00
committed by Rob H
parent 59578a73af
commit 9052b1c3db
5 changed files with 8 additions and 8 deletions

View File

@@ -16,7 +16,7 @@ module Spree
private
def product_selection_from_inventory_only_changed?
key =~ product_selection_from_inventory_only_regex
!!(key =~ product_selection_from_inventory_only_regex)
end
def enterprise

View File

@@ -1,7 +1,7 @@
module OpenFoodNetwork
class FeatureToggle
def self.enabled? feature
features.with_indifferent_access[feature]
!!features.with_indifferent_access[feature]
end
private

View File

@@ -47,12 +47,12 @@ describe Spree::Admin::SearchController, type: :controller do
it 'returns a list of customers of the enterprise' do
expect(@results.size).to eq 2
expect(@results.find { |c| c['id'] == customer_1.id}).to be true
expect(@results.find { |c| c['id'] == customer_2.id}).to be true
expect(@results.find { |c| c['id'] == customer_1.id}).to be_truthy
expect(@results.find { |c| c['id'] == customer_2.id}).to be_truthy
end
it 'does not return the customer of other enterprises' do
expect(@results.find { |c| c['id'] == customer_3.id}).to be false
expect(@results.find { |c| c['id'] == customer_3.id}).to be_nil
p customer_3
p enterprise
end

View File

@@ -54,7 +54,7 @@ feature %q{
product.tax_category_id.should == tax_category.id
product.shipping_category.should == shipping_category
product.description.should == "A description..."
product.group_buy.should be false
product.group_buy.should be_falsey
product.master.option_values.map(&:name).should == ['5kg']
product.master.options_text.should == "5kg"
end

View File

@@ -144,7 +144,7 @@ feature "Registration", js: true do
visit registration_path
click_button "Let's get started!"
find("div#progress-bar").visible?.should be true
expect(find("div#progress-bar")).to be_visible
end
end
@@ -160,7 +160,7 @@ feature "Registration", js: true do
perform_and_ensure(:check, "accept_terms", lambda { page.has_no_selector? "input.button.primary[disabled]" })
click_button "Let's get started!"
find("div#progress-bar").visible?.should be true
expect(find("div#progress-bar")).to be_visible
end
end
end