General functionality improvement
This commit is contained in:
@@ -30,16 +30,3 @@ step "I am signed in as a user" do
|
||||
step "I visit the user obtain token path"
|
||||
end
|
||||
|
||||
step "the other user should be added to the active list" do
|
||||
@other_user.reload
|
||||
@list.reload
|
||||
@other_user.active_list_id.should == @list.id
|
||||
@list.user_ids.should =~ [@user.id, @other_user.id]
|
||||
end
|
||||
|
||||
step "the other user should not be added to the active list" do
|
||||
@other_user.reload
|
||||
@list.reload
|
||||
@other_user.active_list_id.should be_nil
|
||||
@list.user_ids.should == [@user.id]
|
||||
end
|
||||
|
||||
@@ -39,7 +39,3 @@ step "the other user clicks the join table button" do
|
||||
find('.join-table-button').click
|
||||
end
|
||||
|
||||
step "the other user should be redirected to the user menu page" do
|
||||
Capybara.session_name = :other_user
|
||||
route_should_be 'user#list_products'
|
||||
end
|
||||
|
||||
@@ -134,6 +134,7 @@ step "the active list changes to another table in another section" do
|
||||
end
|
||||
|
||||
step "the supplier main board table number should be updated to the new table number" do
|
||||
binding.pry
|
||||
expect( find(".list-row-#{@list.id} .table_number").text ).to eq "65"
|
||||
expect( find(".order-row-#{@list.orders.first.id} .table_number").text ).to eq "65"
|
||||
end
|
||||
|
||||
@@ -1,8 +1,10 @@
|
||||
step "the original user should see a join request message" do
|
||||
Capybara.session_name = :default
|
||||
request_text = page.evaluate_script(%|t('join_request.body', {email: '#{@other_user.email}'})|)
|
||||
request_text.should be_present
|
||||
page.should have_content request_text
|
||||
#request_text = page.evaluate_script(%|t('join_request.body', {email: '#{@other_user.email}'})|)
|
||||
request_title = page.evaluate_script(%|t('join_request.existing_user.title')|)
|
||||
request_title.should be_present
|
||||
page.should have_content request_title
|
||||
page.should have_content @other_user.email
|
||||
end
|
||||
|
||||
step "the original user should not see the join request anymore" do
|
||||
@@ -13,11 +15,11 @@ step "the original user should not see the join request anymore" do
|
||||
end
|
||||
|
||||
step "the original user approves the other user's join request" do
|
||||
find('.approve-join-request-button').click
|
||||
find('.join-request-approve').click
|
||||
end
|
||||
|
||||
step "the original user rejects the other user's join request" do
|
||||
find('.reject-join-request-button').click
|
||||
find('.join-request-reject').click
|
||||
end
|
||||
|
||||
step "the other user clicks the show me the menu button" do
|
||||
@@ -33,8 +35,29 @@ end
|
||||
|
||||
step "the other user should see a join reject message" do
|
||||
Capybara.session_name = :other_user
|
||||
reject_text = I18n.t('messages.join_request_rejected')
|
||||
reject_text = page.evaluate_script(%|t('join_request.requestor.join_request_rejected')|)
|
||||
reject_text.should be_present
|
||||
reject_text.should_not include 'translation'
|
||||
page.should have_content reject_text
|
||||
end
|
||||
|
||||
step "the other user should be added to the active list" do
|
||||
sleep 1
|
||||
@other_user.reload
|
||||
@list.reload
|
||||
@other_user.active_list_id.should == @list.id
|
||||
@list.user_ids.should =~ [@user.id, @other_user.id]
|
||||
end
|
||||
|
||||
step "the other user should not be added to the active list" do
|
||||
sleep 1
|
||||
@other_user.reload
|
||||
@list.reload
|
||||
@other_user.active_list_id.should be_nil
|
||||
@list.user_ids.should == [@user.id]
|
||||
end
|
||||
|
||||
step "the other user should be redirected to active list it just joined" do
|
||||
Capybara.session_name = :other_user
|
||||
ember_route_should_be '/active_list'
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user