mirror of
https://github.com/openfoodfoundation/openfoodnetwork
synced 2026-02-27 01:43:22 +00:00
A few updates to spec where 'be true' and 'be false' didn't cut it
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
module OpenFoodNetwork
|
||||
class FeatureToggle
|
||||
def self.enabled? feature
|
||||
features.with_indifferent_access[feature]
|
||||
!!features.with_indifferent_access[feature]
|
||||
end
|
||||
|
||||
private
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user