big refactor for test and admin namespace
This commit is contained in:
@@ -1,21 +0,0 @@
|
||||
require 'acceptance/acceptance_helper'
|
||||
|
||||
feature 'Supplier main board spec.rb', %q{
|
||||
In order to manage active orders
|
||||
As a supplier
|
||||
I want to have control
|
||||
} do
|
||||
background do
|
||||
create_supplier 'supplier@qwaiter.com'
|
||||
create_user 'user@qwaiter.com'
|
||||
end
|
||||
def create_active_list(options = {})
|
||||
|
||||
end
|
||||
|
||||
scenario 'loaded orders should have a list_id present for handling actions' do
|
||||
create_active_list
|
||||
login_supplier_as 'supplier@qwaiter.com'
|
||||
end
|
||||
|
||||
end
|
||||
@@ -0,0 +1,46 @@
|
||||
require 'acceptance/acceptance_helper'
|
||||
|
||||
@javascript
|
||||
feature 'Supplier main board spec.rb', %q{
|
||||
In order to manage active orders
|
||||
As a supplier
|
||||
I want to have control
|
||||
} do
|
||||
background do
|
||||
CouchPotato.couchrest_database.recreate!
|
||||
create_supplier 'supplier@qwaiter.com'
|
||||
create_user 'user@qwaiter.com'
|
||||
end
|
||||
def create_active_list(options = {})
|
||||
@table = create :table, supplier: @supplier
|
||||
@list = create :list, supplier: @supplier, table: @table, user_ids: [@user.id]
|
||||
|
||||
end
|
||||
context "using javascript", js: true do
|
||||
scenario 'the active list should be present and contained in row having its id' do
|
||||
create_active_list
|
||||
login_supplier_as 'supplier@qwaiter.com'
|
||||
visit '/supplier'
|
||||
page.should have_selector "#list-row-#{@list.id}"
|
||||
end
|
||||
|
||||
scenario 'order is added to the list before visiting the page' do
|
||||
create_active_list
|
||||
login_supplier_as 'supplier@qwaiter.com'
|
||||
product = create :product, supplier: @supplier
|
||||
sleep 0.1
|
||||
@list.place_order @user, {product.id => 369}
|
||||
visit '/supplier'
|
||||
page.should have_selector ".of-list-#{@list.id}"
|
||||
end
|
||||
|
||||
scenario 'order is added to the list after visiting the page' do
|
||||
create_active_list
|
||||
login_supplier_as 'supplier@qwaiter.com'
|
||||
product = create :product, supplier: @supplier
|
||||
visit '/supplier'
|
||||
@list.place_order @user, {product.id => 369}
|
||||
page.should have_selector ".of-list-#{@list.id}"
|
||||
end
|
||||
end
|
||||
end
|
||||
Reference in New Issue
Block a user