before switch to ubuntu commit since apple has issues
This commit is contained in:
@@ -3,12 +3,6 @@ step "the user scans a table QR code" do
|
||||
page.execute_script "App.__container__.lookup('route:application').transitionTo('table','#{@table.id}')"
|
||||
end
|
||||
|
||||
step "another user scans the QR code on the table" do
|
||||
step 'there is another signed in user user'
|
||||
visit user_root_path
|
||||
page.execute_script "App.__container__.lookup('route:application').transitionTo('table','#{@table.id}')"
|
||||
end
|
||||
|
||||
step "I am on the user homepage" do
|
||||
step "the user is on the homepage"
|
||||
end
|
||||
|
||||
@@ -14,6 +14,14 @@ step "the original user should not see the join request anymore" do
|
||||
page.should_not have_content request_text
|
||||
end
|
||||
|
||||
step "another user scans the QR code on the table" do
|
||||
step 'there is another signed in user user'
|
||||
visit user_root_path
|
||||
when_ember_is_ready do
|
||||
page.execute_script "App.__container__.lookup('route:application').transitionTo('table','#{@table.id}')"
|
||||
end
|
||||
end
|
||||
|
||||
step "the original user approves the other user's join request" do
|
||||
find('.join-request-approve').click
|
||||
end
|
||||
|
||||
@@ -2,5 +2,8 @@ FactoryGirl.define do
|
||||
factory :list do
|
||||
association :table
|
||||
association :supplier #TODO warning! this may create a different supplier than the one created by the associated table
|
||||
trait :active do
|
||||
#default
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
@@ -164,4 +164,14 @@ describe List do
|
||||
expect( list.needs_help? ).not_to be true
|
||||
end
|
||||
end
|
||||
context 'class_methods' do
|
||||
describe 'active_for_supplier' do
|
||||
|
||||
it 'only returns the lists for the supplier' do
|
||||
other_supplier = create :supplier, open: true
|
||||
other_list = create :list, :active, supplier: other_supplier
|
||||
described_class.active_for_supplier( list.supplier ).should eq [list]
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
@@ -101,4 +101,16 @@ module SpecEmberHelpers
|
||||
def faye_log
|
||||
JSON.parse(page.evaluate_script(%|JSON.stringify(window.faye_log)|))
|
||||
end
|
||||
|
||||
def when_ember_is_ready(&blk)
|
||||
times = 0
|
||||
ember_ready = page.evaluate_script('window.ember_ready')
|
||||
while not ember_ready or times < 30
|
||||
sleep 0.1
|
||||
ember_ready = page.evaluate_script('window.ember_ready')
|
||||
times += 1
|
||||
end
|
||||
raise "Ember is not loaded and should be" unless ember_ready
|
||||
blk.call
|
||||
end
|
||||
end
|
||||
|
||||
@@ -18,9 +18,11 @@ module SpecRouteHelpers
|
||||
max_wait = 4
|
||||
time = 0.0
|
||||
time_step = 0.25
|
||||
while time < max_wait && ember_route != route_def
|
||||
current_route = ember_route
|
||||
while time < max_wait && current_route != route_def
|
||||
time += time_step
|
||||
sleep time_step
|
||||
current_route = ember_route
|
||||
end
|
||||
ember_route(omit_should_raise: true).should == route_def
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user