Poltergeist in the green, and resourceful refactor
This commit is contained in:
@@ -33,5 +33,19 @@ step "I open the debugger" do
|
||||
end
|
||||
|
||||
step 'I reload the page' do
|
||||
page.driver.browser.navigate.refresh()
|
||||
case Capybara.current_driver
|
||||
when :selenium then page.driver.browser.navigate.refresh()
|
||||
when :poltergeist
|
||||
visit page.current_url
|
||||
sleep 1
|
||||
#steps = 0
|
||||
#r = page.evaluate_script 'window.ember_ready'
|
||||
#while !r and steps < 20
|
||||
#sleep 0.1
|
||||
#r = page.evaluate_script 'window.ember_ready'
|
||||
#steps += 1
|
||||
#end
|
||||
else
|
||||
visit page.current_url
|
||||
end
|
||||
end
|
||||
|
||||
@@ -1,15 +0,0 @@
|
||||
# encoding: UTF-8
|
||||
require 'spec_helper'
|
||||
|
||||
describe SupplierController, type: :controller do
|
||||
before :each do
|
||||
setup_supplier_for_controller
|
||||
end
|
||||
|
||||
describe "GET settings" do
|
||||
it 'displays the settings page' do
|
||||
get :edit
|
||||
end
|
||||
end
|
||||
|
||||
end
|
||||
@@ -116,7 +116,7 @@ describe Suppliers::ProductsController, type: :controller do
|
||||
|
||||
it "deletes the product" do
|
||||
expect{
|
||||
delete :destroy, id: @product
|
||||
delete :destroy, id: @product
|
||||
}.to change(Product, :count).by(-1)
|
||||
end
|
||||
|
||||
@@ -128,7 +128,7 @@ describe Suppliers::ProductsController, type: :controller do
|
||||
it "should not be possible to delete a product of another supplier" do
|
||||
product = create :product
|
||||
expect{
|
||||
delete :destroy, id: product
|
||||
delete :destroy, id: product.id
|
||||
}.to_not change(Product, :count)
|
||||
end
|
||||
end
|
||||
|
||||
@@ -6,26 +6,5 @@ describe SupplierController, type: :routing do
|
||||
it "routes root to #home" do
|
||||
get("/supplier").should route_to("supplier#home")
|
||||
end
|
||||
it "routes to #active_orders" do
|
||||
get("/supplier/active_orders").should route_to("supplier#active_orders")
|
||||
end
|
||||
it "routes to #active_lists" do
|
||||
get("/supplier/active_lists").should route_to("supplier#active_lists")
|
||||
end
|
||||
it "routes to #mark_as_open" do
|
||||
post("/supplier/mark_as_open").should route_to("supplier#mark_as_open")
|
||||
end
|
||||
it "routes to #mark_as_closed" do
|
||||
post("/supplier/mark_as_closed").should route_to("supplier#mark_as_closed")
|
||||
end
|
||||
it "routes to #settings" do
|
||||
get("/supplier/settings").should route_to("supplier#edit")
|
||||
end
|
||||
it "routes to #update via put" do
|
||||
put("/supplier/settings").should route_to("supplier#update")
|
||||
end
|
||||
it "routes to #update via post" do
|
||||
post("/supplier/settings").should route_to("supplier#update")
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user