... | @@ -15,3 +15,32 @@ test "should list skus not generated" do |
... | @@ -15,3 +15,32 @@ test "should list skus not generated" do |
|
end
|
|
end
|
|
end
|
|
end
|
|
```
|
|
```
|
|
|
|
|
|
|
|
Example of stub using mocha.
|
|
|
|
|
|
|
|
```ruby
|
|
|
|
test "should allow director to send order to production" do
|
|
|
|
sign_in users(:user_director)
|
|
|
|
|
|
|
|
page.visit('/orders')
|
|
|
|
order_row_xpath = page.first(:xpath,
|
|
|
|
ORDERS_LIST_ROWS,
|
|
|
|
text: 'Com Diretoria').path
|
|
|
|
|
|
|
|
Order.any_instance.stubs(:send_to_gogrids).returns({ url: "http://fakegrids.gocase.com.br/path/to/file.zip" })
|
|
|
|
|
|
|
|
within(:xpath, order_row_xpath) do
|
|
|
|
if Capybara.current_driver.eql? :poltergeist
|
|
|
|
click_on "Opções"
|
|
|
|
click_on "Enviar para Produção"
|
|
|
|
else
|
|
|
|
click_on "Opções"
|
|
|
|
page.accept_confirm do
|
|
|
|
click_on "Enviar para Produção"
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
assert page.has_content?('Em Produção')
|
|
|
|
end
|
|
|
|
end
|
|
|
|
``` |
|
|
|
\ No newline at end of file |