diff --git a/spec/features/chili/enterprises_distributor_info_rich_text_feature_spec.rb b/spec/features/chili/enterprises_distributor_info_rich_text_feature_spec.rb index 4482246878..a000ae2b8b 100644 --- a/spec/features/chili/enterprises_distributor_info_rich_text_feature_spec.rb +++ b/spec/features/chili/enterprises_distributor_info_rich_text_feature_spec.rb @@ -111,6 +111,7 @@ feature "enterprises distributor info as rich text" do login_to_consumer_section click_link 'Green Grass' + visit enterprise_path d # -- Product details page click_link p.name diff --git a/spec/features/consumer/browse_products_spec.rb b/spec/features/consumer/browse_products_spec.rb index a12899d4bc..8213e00035 100644 --- a/spec/features/consumer/browse_products_spec.rb +++ b/spec/features/consumer/browse_products_spec.rb @@ -82,6 +82,7 @@ feature %q{ # When I am in that order cycle visit root_path click_link d.name + visit enterprise_path d # And I view the product click_link p.name diff --git a/spec/features/consumer/checkout_spec.rb b/spec/features/consumer/checkout_spec.rb index b55cc7821a..4f8d4bc3ab 100644 --- a/spec/features/consumer/checkout_spec.rb +++ b/spec/features/consumer/checkout_spec.rb @@ -92,7 +92,7 @@ feature %q{ # When I add some apples and some garlic to my cart click_link 'Fuji apples' click_button 'Add To Cart' - click_link 'Continue shopping' + visit enterprise_path @distributor1 click_link 'Garlic' click_button 'Add To Cart' @@ -112,11 +112,12 @@ feature %q{ # And I am logged in login_to_consumer_section click_link "FruitAndVeg" + visit enterprise_path @distributor1 # When I add some bananas and zucchini to my cart click_link 'Bananas' click_button 'Add To Cart' - click_link 'Continue shopping' + visit enterprise_path @distributor1 click_link 'Zucchini' click_button 'Add To Cart' @@ -355,10 +356,11 @@ feature %q{ login_to_consumer_section click_link 'FruitAndVeg' + visit enterprise_path @distributor1 click_link 'Bananas' click_button 'Add To Cart' - click_link 'Continue shopping' + visit enterprise_path @distributor1 click_link 'Zucchini' click_button 'Add To Cart' @@ -433,12 +435,13 @@ feature %q{ country: Spree::Country.find_by_name('Australia'))) click_link 'FruitAndVeg' - click_link 'Logout' + click_link 'Sign Out' click_link 'FruitAndVeg' + visit enterprise_path @distributor1 click_link 'Bananas' click_button 'Add To Cart' - click_link 'Continue shopping' + visit enterprise_path @distributor1 click_link 'Zucchini' click_button 'Add To Cart' @@ -529,6 +532,7 @@ feature %q{ # Distributors distributor1 = FactoryGirl.create(:distributor_enterprise, name: "FruitAndVeg") + @distributor1 = distributor1 distributor2 = FactoryGirl.create(:distributor_enterprise, name: "MoreFreshStuff") create_enterprise_group_for distributor1 distributor_fee1 = create(:enterprise_fee, enterprise: distributor1, fee_type: 'packing', amount: 7) diff --git a/spec/features/consumer/cms_spec.rb b/spec/features/consumer/cms_spec.rb index 36653bea01..de52f2973e 100644 --- a/spec/features/consumer/cms_spec.rb +++ b/spec/features/consumer/cms_spec.rb @@ -7,9 +7,9 @@ feature %q{ } do include AuthenticationWorkflow include WebHelper + let(:d) { create(:distributor_enterprise, :name => 'Edible garden') } background do - d = create(:distributor_enterprise, :name => 'Edible garden') create_enterprise_group_for d end @@ -22,6 +22,7 @@ feature %q{ # and proceed to the shop front click_on 'Edible garden' + visit enterprise_path d # Then I should not see the home page content page.should_not have_content 'Home page content' @@ -36,9 +37,10 @@ feature %q{ # When I visit the home page visit spree.root_path - # and proceed to the shop front click_on "Edible garden" + visit enterprise_path d + # Then I should see a menu with these pages page.should have_selector 'ul#main-nav-bar li', :text => 'One' @@ -56,6 +58,7 @@ feature %q{ # When I go to one of the pages visit spree.root_path click_on "Edible garden" + visit enterprise_path d click_link 'Two' # Then I should see the page diff --git a/spec/features/consumer/distributors_spec.rb b/spec/features/consumer/distributors_spec.rb index f4652ac5b9..70b38dddbd 100644 --- a/spec/features/consumer/distributors_spec.rb +++ b/spec/features/consumer/distributors_spec.rb @@ -101,8 +101,7 @@ feature %q{ click_link d1.name # Then I should see the distributor details - page.should have_selector 'h1', :text => d1.name - page.should have_selector 'div.enterprise-description', :text => 'Hello, world!' + page.should have_content d1.name # And I should see the first, but not the second product page.should have_content p1.name diff --git a/spec/features/consumer/order_cycles_spec.rb b/spec/features/consumer/order_cycles_spec.rb index 591b7af002..ea4dde4147 100644 --- a/spec/features/consumer/order_cycles_spec.rb +++ b/spec/features/consumer/order_cycles_spec.rb @@ -44,6 +44,7 @@ feature %q{ visit spree.root_path click_link d.name + visit enterprise_path d page.should have_select 'order_order_cycle_id' select_by_value oc1.id, from: 'order_order_cycle_id' @@ -63,9 +64,10 @@ feature %q{ oc1 = create(:simple_order_cycle, name: 'oc 1', distributors: [d1], orders_close_at: 5.minutes.ago) oc2 = create(:simple_order_cycle, name: 'oc 1', distributors: [d2], orders_close_at: 3.minutes.ago) click_link d1.name + visit enterprise_path d1 page.should have_content "Orders are currently closed for this hub" - page.should have_content "The last cycle closed 5 minutes ago." + page.should have_content "The last cycle closed 5 minutes ago" page.should have_content "Please contact your hub directly to see if they accept late orders, or wait until the next cycle opens." page.should have_content d1.email page.should have_content d1.phone @@ -77,11 +79,14 @@ feature %q{ create(:simple_order_cycle, name: 'oc 1', distributors: [d1], orders_open_at: 10.days.from_now, orders_close_at: 11.days.from_now) click_link d1.name + visit enterprise_path d1 + page.should have_content "The next order cycle opens in 10 days" end it "should show nothing when there is no next order cycle" do click_link d1.name + visit enterprise_path d1 page.should_not have_content "The next order cycle opens" page.should_not have_content "No products found" end @@ -97,6 +102,7 @@ feature %q{ visit spree.root_path click_link d.name + visit enterprise_path d click_link p.name click_button 'Add To Cart' @@ -148,6 +154,7 @@ feature %q{ # When I select an order cycle and add a product to my cart visit spree.root_path click_link 'Green Grass' + visit enterprise_path d click_link p.name click_button 'Add To Cart' diff --git a/spec/features/consumer/suppliers_spec.rb b/spec/features/consumer/suppliers_spec.rb index ca5430e93f..7c69c2e64b 100644 --- a/spec/features/consumer/suppliers_spec.rb +++ b/spec/features/consumer/suppliers_spec.rb @@ -30,10 +30,7 @@ feature %q{ click_link d.name # Then that hub should be selected - page.should have_selector 'h1', text: d.name - - # And I should be on the hub page - within('#products') { page.should have_content p.name } + page.should have_content d.name end scenario "viewing a list of suppliers (with active products) in the sidebar when there's 5 or fewer", :future => true do diff --git a/spec/features/consumer/temp_landing_page_spec.rb b/spec/features/consumer/temp_landing_page_spec.rb index 5a111aa132..183284514f 100644 --- a/spec/features/consumer/temp_landing_page_spec.rb +++ b/spec/features/consumer/temp_landing_page_spec.rb @@ -74,7 +74,7 @@ feature %q{ it "should link to the hub page" do click_on 'Murandaka' - page.should have_content 'CART' + current_path.should == "/shop" end end