Use have_current_path rather than current_path.should ==

This commit is contained in:
Rob Harrington
2016-05-11 15:19:28 +10:00
parent 2c9697ff4e
commit 7e932f091d
7 changed files with 12 additions and 12 deletions

View File

@@ -16,14 +16,14 @@ feature "Authentication", js: true do
fill_in "Email", with: user.email
fill_in "Password", with: user.password
click_login_button
page.should have_content "DASHBOARD"
current_path.should == spree.admin_path
expect(page).to have_content "DASHBOARD"
expect(page).to have_current_path spree.admin_path
end
end
scenario "viewing my account" do
login_to_admin_section
click_link "Account"
current_path.should == spree.account_path
expect(page).to have_current_path spree.account_path
end
end

View File

@@ -15,7 +15,7 @@ feature %q{
page.should have_content "ComfortableMexicanSofa"
click_link 'Spree Admin'
current_path.should match(/^\/admin/)
expect(page).to have_current_path /^\/admin/
end
scenario "anonymous user can't access CMS admin", js: true do
@@ -29,6 +29,6 @@ feature %q{
page.should_not have_content "Login"
visit cms_admin_path
page.should_not have_content "ComfortableMexicanSofa"
current_path.should == root_path
expect(page).to have_current_path root_path
end
end

View File

@@ -153,7 +153,7 @@ feature %q{
login_to_admin_section
visit '/admin/orders'
current_path.should == spree.admin_orders_path
expect(page).to have_current_path spree.admin_orders_path
# click the 'capture' link for the order
page.find("[data-action=capture][href*=#{@order.number}]").click
@@ -165,7 +165,7 @@ feature %q{
@order.payment_state.should == "paid"
# we should still be on the same page
current_path.should == spree.admin_orders_path
expect(page).to have_current_path spree.admin_orders_path
end

View File

@@ -94,7 +94,7 @@ feature %q{
click_link "Payment Methods"
end
click_link 'Create One Now'
current_path.should == spree.new_admin_payment_method_path
expect(page).to have_current_path spree.new_admin_payment_method_path
end
it "creates payment methods" do

View File

@@ -18,7 +18,7 @@ feature "Authentication", js: true, retry: 3 do
fill_in "Password", with: user.password
click_login_button
page.should have_content "Find local producers"
current_path.should == producers_path
expect(page).to have_current_path producers_path
end
end

View File

@@ -43,12 +43,12 @@ feature 'Shops', js: true do
it "should link to the hub page" do
follow_active_table_node distributor.name
current_path.should == enterprise_shop_path(distributor)
expect(page).to have_current_path enterprise_shop_path(distributor)
end
it "should show hub producer modals" do
expand_active_table_node distributor.name
page.should have_content producer.name
expect(page).to have_content producer.name
open_enterprise_modal producer
modal_should_be_open_for producer
end

View File

@@ -29,7 +29,7 @@ module WebHelper
def current_path_should_be path
current_path = URI.parse(current_url).path
current_path.should == path
expect(page).to have_current_path path
end
def fill_in_fields(field_values)