Transpec feature specs brought from spre_backend

This commit is contained in:
luisramos0
2019-09-17 18:52:45 +01:00
parent 4a83eca832
commit f9c6f09cd4
2 changed files with 13 additions and 13 deletions

View File

@@ -31,7 +31,7 @@ describe "States" do
it "should correctly display the states" do
visit spree.admin_country_states_path(country)
page.should have_content(state.name)
expect(page).to have_content(state.name)
end
end
@@ -44,8 +44,8 @@ describe "States" do
fill_in "state_name", :with => "Calgary"
fill_in "Abbreviation", :with => "CL"
click_button "Create"
page.should have_content("successfully created!")
page.should have_content("Calgary")
expect(page).to have_content("successfully created!")
expect(page).to have_content("Calgary")
end
it "should allow an admin to create states for non default countries", :js => true do
@@ -59,9 +59,9 @@ describe "States" do
fill_in "state_name", :with => "Pest megye"
fill_in "Abbreviation", :with => "PE"
click_button "Create"
page.should have_content("successfully created!")
page.should have_content("Pest megye")
find("#s2id_country span.select2-chosen").text.should == "Hungary"
expect(page).to have_content("successfully created!")
expect(page).to have_content("Pest megye")
expect(find("#s2id_country span.select2-chosen").text).to eq("Hungary")
end
it "should show validation errors", :js => true do
@@ -73,7 +73,7 @@ describe "States" do
fill_in "state_name", :with => ""
fill_in "Abbreviation", :with => ""
click_button "Create"
page.should have_content("Name can't be blank")
expect(page).to have_content("Name can't be blank")
end
end
end

View File

@@ -16,13 +16,13 @@ describe "Zones" do
create(:zone, :name => "western", :description => "cool san fran")
click_link "Zones"
within_row(1) { page.should have_content("eastern") }
within_row(2) { page.should have_content("western") }
within_row(1) { expect(page).to have_content("eastern") }
within_row(2) { expect(page).to have_content("western") }
click_link "zones_order_by_description_title"
within_row(1) { page.should have_content("western") }
within_row(2) { page.should have_content("eastern") }
within_row(1) { expect(page).to have_content("western") }
within_row(2) { expect(page).to have_content("eastern") }
end
end
@@ -30,11 +30,11 @@ describe "Zones" do
it "should allow an admin to create a new zone" do
click_link "Zones"
click_link "admin_new_zone_link"
page.should have_content("New Zone")
expect(page).to have_content("New Zone")
fill_in "zone_name", :with => "japan"
fill_in "zone_description", :with => "japanese time zone"
click_button "Create"
page.should have_content("successfully created!")
expect(page).to have_content("successfully created!")
end
end
end