mirror of
https://github.com/openfoodfoundation/openfoodnetwork
synced 2026-02-27 01:43:22 +00:00
Fixing up a bunch of specs to accommodate the new routing
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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)
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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'
|
||||
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
|
||||
Reference in New Issue
Block a user