Commit 2dac8f44 authored by Robert Speicher's avatar Robert Speicher

Remove implicit dependency on `gitlab_sign_in` assigning `@user`

We shouldn't be using instance variables in specs to begin with, and
depending on this implicit behavior of `gitlab_sign_in` would have made
it more difficult to change to `sign_in` where possible.

...we've also gone ahead and changed to `sign_in` where possible.
parent 1c64fa08
...@@ -4,10 +4,11 @@ describe 'Commits' do ...@@ -4,10 +4,11 @@ describe 'Commits' do
include CiStatusHelper include CiStatusHelper
let(:project) { create(:project, :repository) } let(:project) { create(:project, :repository) }
let(:user) { create(:user) }
describe 'CI' do describe 'CI' do
before do before do
gitlab_sign_in :user sign_in(user)
stub_ci_pipeline_to_return_yaml_file stub_ci_pipeline_to_return_yaml_file
end end
...@@ -27,7 +28,7 @@ describe 'Commits' do ...@@ -27,7 +28,7 @@ describe 'Commits' do
let!(:status) { create(:generic_commit_status, pipeline: pipeline) } let!(:status) { create(:generic_commit_status, pipeline: pipeline) }
before do before do
project.team << [@user, :reporter] project.team << [user, :reporter]
end end
describe 'Commit builds' do describe 'Commit builds' do
...@@ -52,7 +53,7 @@ describe 'Commits' do ...@@ -52,7 +53,7 @@ describe 'Commits' do
context 'when logged as developer' do context 'when logged as developer' do
before do before do
project.team << [@user, :developer] project.team << [user, :developer]
end end
describe 'Project commits' do describe 'Project commits' do
...@@ -146,7 +147,7 @@ describe 'Commits' do ...@@ -146,7 +147,7 @@ describe 'Commits' do
context "when logged as reporter" do context "when logged as reporter" do
before do before do
project.team << [@user, :reporter] project.team << [user, :reporter]
build.update_attributes(artifacts_file: artifacts_file) build.update_attributes(artifacts_file: artifacts_file)
visit ci_status_path(pipeline) visit ci_status_path(pipeline)
end end
...@@ -187,11 +188,10 @@ describe 'Commits' do ...@@ -187,11 +188,10 @@ describe 'Commits' do
context 'viewing commits for a branch' do context 'viewing commits for a branch' do
let(:branch_name) { 'master' } let(:branch_name) { 'master' }
let(:user) { create(:user) }
before do before do
project.team << [user, :master] project.team << [user, :master]
gitlab_sign_in(user) sign_in(user)
visit namespace_project_commits_path(project.namespace, project, branch_name) visit namespace_project_commits_path(project.namespace, project, branch_name)
end end
......
require 'spec_helper' require 'spec_helper'
describe "GitLab Flavored Markdown", feature: true do describe "GitLab Flavored Markdown", feature: true do
let(:user) { create(:user) }
let(:project) { create(:empty_project) } let(:project) { create(:empty_project) }
let(:issue) { create(:issue, project: project) } let(:issue) { create(:issue, project: project) }
let(:fred) do let(:fred) do
...@@ -10,8 +11,8 @@ describe "GitLab Flavored Markdown", feature: true do ...@@ -10,8 +11,8 @@ describe "GitLab Flavored Markdown", feature: true do
end end
before do before do
gitlab_sign_in(:user) sign_in(user)
project.add_developer(@user) project.add_developer(user)
end end
describe "for commits" do describe "for commits" do
...@@ -51,12 +52,12 @@ describe "GitLab Flavored Markdown", feature: true do ...@@ -51,12 +52,12 @@ describe "GitLab Flavored Markdown", feature: true do
describe "for issues", feature: true, js: true do describe "for issues", feature: true, js: true do
before do before do
@other_issue = create(:issue, @other_issue = create(:issue,
author: @user, author: user,
assignees: [@user], assignees: [user],
project: project) project: project)
@issue = create(:issue, @issue = create(:issue,
author: @user, author: user,
assignees: [@user], assignees: [user],
project: project, project: project,
title: "fix #{@other_issue.to_reference}", title: "fix #{@other_issue.to_reference}",
description: "ask #{fred.to_reference} for details") description: "ask #{fred.to_reference} for details")
......
...@@ -5,20 +5,21 @@ describe 'Issues', feature: true do ...@@ -5,20 +5,21 @@ describe 'Issues', feature: true do
include IssueHelpers include IssueHelpers
include SortingHelper include SortingHelper
let(:user) { create(:user) }
let(:project) { create(:empty_project, :public) } let(:project) { create(:empty_project, :public) }
before do before do
gitlab_sign_in :user sign_in(user)
user2 = create(:user) user2 = create(:user)
project.team << [[@user, user2], :developer] project.team << [[user, user2], :developer]
end end
describe 'Edit issue' do describe 'Edit issue' do
let!(:issue) do let!(:issue) do
create(:issue, create(:issue,
author: @user, author: user,
assignees: [@user], assignees: [user],
project: project) project: project)
end end
...@@ -35,15 +36,15 @@ describe 'Issues', feature: true do ...@@ -35,15 +36,15 @@ describe 'Issues', feature: true do
describe 'Editing issue assignee' do describe 'Editing issue assignee' do
let!(:issue) do let!(:issue) do
create(:issue, create(:issue,
author: @user, author: user,
assignees: [@user], assignees: [user],
project: project) project: project)
end end
it 'allows user to select unassigned', js: true do it 'allows user to select unassigned', js: true do
visit edit_namespace_project_issue_path(project.namespace, project, issue) visit edit_namespace_project_issue_path(project.namespace, project, issue)
expect(page).to have_content "Assignee #{@user.name}" expect(page).to have_content "Assignee #{user.name}"
first('.js-user-search').click first('.js-user-search').click
click_link 'Unassigned' click_link 'Unassigned'
...@@ -86,7 +87,7 @@ describe 'Issues', feature: true do ...@@ -86,7 +87,7 @@ describe 'Issues', feature: true do
end end
context 'on edit form' do context 'on edit form' do
let(:issue) { create(:issue, author: @user, project: project, due_date: Date.today.at_beginning_of_month.to_s) } let(:issue) { create(:issue, author: user, project: project, due_date: Date.today.at_beginning_of_month.to_s) }
before do before do
visit edit_namespace_project_issue_path(project.namespace, project, issue) visit edit_namespace_project_issue_path(project.namespace, project, issue)
...@@ -131,10 +132,10 @@ describe 'Issues', feature: true do ...@@ -131,10 +132,10 @@ describe 'Issues', feature: true do
describe 'Issue info' do describe 'Issue info' do
it 'excludes award_emoji from comment count' do it 'excludes award_emoji from comment count' do
issue = create(:issue, author: @user, assignees: [@user], project: project, title: 'foobar') issue = create(:issue, author: user, assignees: [user], project: project, title: 'foobar')
create(:award_emoji, awardable: issue) create(:award_emoji, awardable: issue)
visit namespace_project_issues_path(project.namespace, project, assignee_id: @user.id) visit namespace_project_issues_path(project.namespace, project, assignee_id: user.id)
expect(page).to have_content 'foobar' expect(page).to have_content 'foobar'
expect(page.all('.no-comments').first.text).to eq "0" expect(page.all('.no-comments').first.text).to eq "0"
...@@ -145,8 +146,8 @@ describe 'Issues', feature: true do ...@@ -145,8 +146,8 @@ describe 'Issues', feature: true do
before do before do
%w(foobar barbaz gitlab).each do |title| %w(foobar barbaz gitlab).each do |title|
create(:issue, create(:issue,
author: @user, author: user,
assignees: [@user], assignees: [user],
project: project, project: project,
title: title) title: title)
end end
...@@ -168,7 +169,7 @@ describe 'Issues', feature: true do ...@@ -168,7 +169,7 @@ describe 'Issues', feature: true do
end end
it 'allows filtering by a specified assignee' do it 'allows filtering by a specified assignee' do
visit namespace_project_issues_path(project.namespace, project, assignee_id: @user.id) visit namespace_project_issues_path(project.namespace, project, assignee_id: user.id)
expect(page).not_to have_content 'foobar' expect(page).not_to have_content 'foobar'
expect(page).to have_content 'barbaz' expect(page).to have_content 'barbaz'
...@@ -366,13 +367,13 @@ describe 'Issues', feature: true do ...@@ -366,13 +367,13 @@ describe 'Issues', feature: true do
end end
describe 'when I want to reset my incoming email token' do describe 'when I want to reset my incoming email token' do
let(:project1) { create(:empty_project, namespace: @user.namespace) } let(:project1) { create(:empty_project, namespace: user.namespace) }
let!(:issue) { create(:issue, project: project1) } let!(:issue) { create(:issue, project: project1) }
before do before do
stub_incoming_email_setting(enabled: true, address: "p+%{key}@gl.ab") stub_incoming_email_setting(enabled: true, address: "p+%{key}@gl.ab")
project1.team << [@user, :master] project1.team << [user, :master]
visit namespace_project_issues_path(@user.namespace, project1) visit namespace_project_issues_path(user.namespace, project1)
end end
it 'changes incoming email address token', js: true do it 'changes incoming email address token', js: true do
...@@ -383,7 +384,7 @@ describe 'Issues', feature: true do ...@@ -383,7 +384,7 @@ describe 'Issues', feature: true do
wait_for_requests wait_for_requests
expect(page).to have_no_field('issue_email', with: previous_token) expect(page).to have_no_field('issue_email', with: previous_token)
new_token = project1.new_issue_address(@user.reload) new_token = project1.new_issue_address(user.reload)
expect(page).to have_field( expect(page).to have_field(
'issue_email', 'issue_email',
with: new_token with: new_token
...@@ -392,7 +393,7 @@ describe 'Issues', feature: true do ...@@ -392,7 +393,7 @@ describe 'Issues', feature: true do
end end
describe 'update labels from issue#show', js: true do describe 'update labels from issue#show', js: true do
let(:issue) { create(:issue, project: project, author: @user, assignees: [@user]) } let(:issue) { create(:issue, project: project, author: user, assignees: [user]) }
let!(:label) { create(:label, project: project) } let!(:label) { create(:label, project: project) }
before do before do
...@@ -411,14 +412,14 @@ describe 'Issues', feature: true do ...@@ -411,14 +412,14 @@ describe 'Issues', feature: true do
end end
describe 'update assignee from issue#show' do describe 'update assignee from issue#show' do
let(:issue) { create(:issue, project: project, author: @user, assignees: [@user]) } let(:issue) { create(:issue, project: project, author: user, assignees: [user]) }
context 'by authorized user' do context 'by authorized user' do
it 'allows user to select unassigned', js: true do it 'allows user to select unassigned', js: true do
visit namespace_project_issue_path(project.namespace, project, issue) visit namespace_project_issue_path(project.namespace, project, issue)
page.within('.assignee') do page.within('.assignee') do
expect(page).to have_content "#{@user.name}" expect(page).to have_content "#{user.name}"
click_link 'Edit' click_link 'Edit'
click_link 'Unassigned' click_link 'Unassigned'
...@@ -433,7 +434,7 @@ describe 'Issues', feature: true do ...@@ -433,7 +434,7 @@ describe 'Issues', feature: true do
end end
it 'allows user to select an assignee', js: true do it 'allows user to select an assignee', js: true do
issue2 = create(:issue, project: project, author: @user) issue2 = create(:issue, project: project, author: user)
visit namespace_project_issue_path(project.namespace, project, issue2) visit namespace_project_issue_path(project.namespace, project, issue2)
page.within('.assignee') do page.within('.assignee') do
...@@ -445,28 +446,28 @@ describe 'Issues', feature: true do ...@@ -445,28 +446,28 @@ describe 'Issues', feature: true do
end end
page.within '.dropdown-menu-user' do page.within '.dropdown-menu-user' do
click_link @user.name click_link user.name
end end
page.within('.assignee') do page.within('.assignee') do
expect(page).to have_content @user.name expect(page).to have_content user.name
end end
end end
it 'allows user to unselect themselves', js: true do it 'allows user to unselect themselves', js: true do
issue2 = create(:issue, project: project, author: @user) issue2 = create(:issue, project: project, author: user)
visit namespace_project_issue_path(project.namespace, project, issue2) visit namespace_project_issue_path(project.namespace, project, issue2)
page.within '.assignee' do page.within '.assignee' do
click_link 'Edit' click_link 'Edit'
click_link @user.name click_link user.name
page.within '.value .author' do page.within '.value .author' do
expect(page).to have_content @user.name expect(page).to have_content user.name
end end
click_link 'Edit' click_link 'Edit'
click_link @user.name click_link user.name
page.within '.value .assign-yourself' do page.within '.value .assign-yourself' do
expect(page).to have_content "No assignee" expect(page).to have_content "No assignee"
...@@ -483,8 +484,8 @@ describe 'Issues', feature: true do ...@@ -483,8 +484,8 @@ describe 'Issues', feature: true do
end end
it 'shows assignee text', js: true do it 'shows assignee text', js: true do
gitlab_sign_out sign_out(:user)
gitlab_sign_in guest sign_in(guest)
visit namespace_project_issue_path(project.namespace, project, issue) visit namespace_project_issue_path(project.namespace, project, issue)
expect(page).to have_content issue.assignees.first.name expect(page).to have_content issue.assignees.first.name
...@@ -493,7 +494,7 @@ describe 'Issues', feature: true do ...@@ -493,7 +494,7 @@ describe 'Issues', feature: true do
end end
describe 'update milestone from issue#show' do describe 'update milestone from issue#show' do
let!(:issue) { create(:issue, project: project, author: @user) } let!(:issue) { create(:issue, project: project, author: user) }
let!(:milestone) { create(:milestone, project: project) } let!(:milestone) { create(:milestone, project: project) }
context 'by authorized user' do context 'by authorized user' do
...@@ -546,8 +547,8 @@ describe 'Issues', feature: true do ...@@ -546,8 +547,8 @@ describe 'Issues', feature: true do
end end
it 'shows milestone text', js: true do it 'shows milestone text', js: true do
gitlab_sign_out sign_out(:user)
gitlab_sign_in guest sign_in(guest)
visit namespace_project_issue_path(project.namespace, project, issue) visit namespace_project_issue_path(project.namespace, project, issue)
expect(page).to have_content milestone.title expect(page).to have_content milestone.title
...@@ -560,7 +561,7 @@ describe 'Issues', feature: true do ...@@ -560,7 +561,7 @@ describe 'Issues', feature: true do
context 'by unauthenticated user' do context 'by unauthenticated user' do
before do before do
gitlab_sign_out sign_out(:user)
end end
it 'redirects to signin then back to new issue after signin' do it 'redirects to signin then back to new issue after signin' do
...@@ -570,7 +571,9 @@ describe 'Issues', feature: true do ...@@ -570,7 +571,9 @@ describe 'Issues', feature: true do
expect(current_path).to eq new_user_session_path expect(current_path).to eq new_user_session_path
gitlab_sign_in :user # NOTE: This is specifically testing the redirect after login, so we
# need the full login flow
gitlab_sign_in(create(:user))
expect(current_path).to eq new_namespace_project_issue_path(project.namespace, project) expect(current_path).to eq new_namespace_project_issue_path(project.namespace, project)
end end
...@@ -599,7 +602,7 @@ describe 'Issues', feature: true do ...@@ -599,7 +602,7 @@ describe 'Issues', feature: true do
before do before do
project.repository.create_file( project.repository.create_file(
@user, user,
'.gitlab/issue_templates/bug.md', '.gitlab/issue_templates/bug.md',
'this is a test "bug" template', 'this is a test "bug" template',
message: 'added issue template', message: 'added issue template',
...@@ -628,7 +631,7 @@ describe 'Issues', feature: true do ...@@ -628,7 +631,7 @@ describe 'Issues', feature: true do
it 'click the button to show modal for the new email' do it 'click the button to show modal for the new email' do
page.within '#issue-email-modal' do page.within '#issue-email-modal' do
email = project.new_issue_address(@user) email = project.new_issue_address(user)
expect(page).to have_selector("input[value='#{email}']") expect(page).to have_selector("input[value='#{email}']")
end end
...@@ -636,7 +639,7 @@ describe 'Issues', feature: true do ...@@ -636,7 +639,7 @@ describe 'Issues', feature: true do
end end
context 'with existing issues' do context 'with existing issues' do
let!(:issue) { create(:issue, project: project, author: @user) } let!(:issue) { create(:issue, project: project, author: user) }
it_behaves_like 'show the email in the modal' it_behaves_like 'show the email in the modal'
end end
...@@ -648,7 +651,7 @@ describe 'Issues', feature: true do ...@@ -648,7 +651,7 @@ describe 'Issues', feature: true do
describe 'due date' do describe 'due date' do
context 'update due on issue#show', js: true do context 'update due on issue#show', js: true do
let(:issue) { create(:issue, project: project, author: @user, assignees: [@user]) } let(:issue) { create(:issue, project: project, author: user, assignees: [user]) }
before do before do
visit namespace_project_issue_path(project.namespace, project, issue) visit namespace_project_issue_path(project.namespace, project, issue)
...@@ -693,7 +696,7 @@ describe 'Issues', feature: true do ...@@ -693,7 +696,7 @@ describe 'Issues', feature: true do
describe 'title issue#show', js: true do describe 'title issue#show', js: true do
it 'updates the title', js: true do it 'updates the title', js: true do
issue = create(:issue, author: @user, assignees: [@user], project: project, title: 'new title') issue = create(:issue, author: user, assignees: [user], project: project, title: 'new title')
visit namespace_project_issue_path(project.namespace, project, issue) visit namespace_project_issue_path(project.namespace, project, issue)
......
require 'spec_helper' require 'spec_helper'
describe 'Branches', feature: true do describe 'Branches', feature: true do
let(:user) { create(:user) }
let(:project) { create(:project, :public) } let(:project) { create(:project, :public) }
let(:repository) { project.repository } let(:repository) { project.repository }
...@@ -12,8 +13,8 @@ describe 'Branches', feature: true do ...@@ -12,8 +13,8 @@ describe 'Branches', feature: true do
context 'logged in as developer' do context 'logged in as developer' do
before do before do
gitlab_sign_in :user sign_in(user)
project.team << [@user, :developer] project.team << [user, :developer]
end end
describe 'Initial branches page' do describe 'Initial branches page' do
...@@ -27,7 +28,7 @@ describe 'Branches', feature: true do ...@@ -27,7 +28,7 @@ describe 'Branches', feature: true do
it 'avoids a N+1 query in branches index' do it 'avoids a N+1 query in branches index' do
control_count = ActiveRecord::QueryRecorder.new { visit namespace_project_branches_path(project.namespace, project) }.count control_count = ActiveRecord::QueryRecorder.new { visit namespace_project_branches_path(project.namespace, project) }.count
%w(one two three four five).each { |ref| repository.add_branch(@user, ref, 'master') } %w(one two three four five).each { |ref| repository.add_branch(user, ref, 'master') }
expect { visit namespace_project_branches_path(project.namespace, project) }.not_to exceed_query_limit(control_count) expect { visit namespace_project_branches_path(project.namespace, project) }.not_to exceed_query_limit(control_count)
end end
...@@ -64,14 +65,14 @@ describe 'Branches', feature: true do ...@@ -64,14 +65,14 @@ describe 'Branches', feature: true do
describe 'Delete protected branch' do describe 'Delete protected branch' do
before do before do
project.add_user(@user, :master) project.add_user(user, :master)
visit namespace_project_protected_branches_path(project.namespace, project) visit namespace_project_protected_branches_path(project.namespace, project)
set_protected_branch_name('fix') set_protected_branch_name('fix')
click_on "Protect" click_on "Protect"
within(".protected-branches-list") { expect(page).to have_content('fix') } within(".protected-branches-list") { expect(page).to have_content('fix') }
expect(ProtectedBranch.count).to eq(1) expect(ProtectedBranch.count).to eq(1)
project.add_user(@user, :developer) project.add_user(user, :developer)
end end
it 'does not allow devleoper to removes protected branch', js: true do it 'does not allow devleoper to removes protected branch', js: true do
...@@ -87,8 +88,8 @@ describe 'Branches', feature: true do ...@@ -87,8 +88,8 @@ describe 'Branches', feature: true do
context 'logged in as master' do context 'logged in as master' do
before do before do
gitlab_sign_in :user sign_in(user)
project.team << [@user, :master] project.team << [user, :master]
end end
describe 'Delete protected branch' do describe 'Delete protected branch' do
......
require 'spec_helper' require 'spec_helper'
describe 'Cherry-pick Commits' do describe 'Cherry-pick Commits' do
let(:user) { create(:user) }
let(:group) { create(:group) } let(:group) { create(:group) }
let(:project) { create(:project, namespace: group) } let(:project) { create(:project, namespace: group) }
let(:master_pickable_commit) { project.commit('7d3b0f7cff5f37573aea97cebfd5692ea1689924') } let(:master_pickable_commit) { project.commit('7d3b0f7cff5f37573aea97cebfd5692ea1689924') }
let(:master_pickable_merge) { project.commit('e56497bb5f03a90a51293fc6d516788730953899') } let(:master_pickable_merge) { project.commit('e56497bb5f03a90a51293fc6d516788730953899') }
before do before do
gitlab_sign_in :user sign_in(user)
project.team << [@user, :master] project.team << [user, :master]
visit namespace_project_commit_path(project.namespace, project, master_pickable_commit.id) visit namespace_project_commit_path(project.namespace, project, master_pickable_commit.id)
end end
......
...@@ -7,7 +7,7 @@ feature 'Triggers', feature: true, js: true do ...@@ -7,7 +7,7 @@ feature 'Triggers', feature: true, js: true do
let(:guest_user) { create(:user) } let(:guest_user) { create(:user) }
before do before do
gitlab_sign_in(user) sign_in(user)
@project = create(:empty_project) @project = create(:empty_project)
@project.team << [user, :master] @project.team << [user, :master]
...@@ -33,7 +33,7 @@ feature 'Triggers', feature: true, js: true do ...@@ -33,7 +33,7 @@ feature 'Triggers', feature: true, js: true do
# See if "trigger creation successful" message displayed and description and owner are correct # See if "trigger creation successful" message displayed and description and owner are correct
expect(page.find('.flash-notice')).to have_content 'Trigger was created successfully.' expect(page.find('.flash-notice')).to have_content 'Trigger was created successfully.'
expect(page.find('.triggers-list')).to have_content 'trigger desc' expect(page.find('.triggers-list')).to have_content 'trigger desc'
expect(page.find('.triggers-list .trigger-owner')).to have_content @user.name expect(page.find('.triggers-list .trigger-owner')).to have_content user.name
end end
end end
...@@ -61,7 +61,7 @@ feature 'Triggers', feature: true, js: true do ...@@ -61,7 +61,7 @@ feature 'Triggers', feature: true, js: true do
# See if "trigger updated successfully" message displayed and description and owner are correct # See if "trigger updated successfully" message displayed and description and owner are correct
expect(page.find('.flash-notice')).to have_content 'Trigger was successfully updated.' expect(page.find('.flash-notice')).to have_content 'Trigger was successfully updated.'
expect(page.find('.triggers-list')).to have_content new_trigger_title expect(page.find('.triggers-list')).to have_content new_trigger_title
expect(page.find('.triggers-list .trigger-owner')).to have_content @user.name expect(page.find('.triggers-list .trigger-owner')).to have_content user.name
end end
scenario 'edit "legacy" trigger and save' do scenario 'edit "legacy" trigger and save' do
...@@ -98,7 +98,7 @@ feature 'Triggers', feature: true, js: true do ...@@ -98,7 +98,7 @@ feature 'Triggers', feature: true, js: true do
page.accept_confirm do page.accept_confirm do
expect(page.find('.flash-notice')).to have_content 'Trigger was re-assigned.' expect(page.find('.flash-notice')).to have_content 'Trigger was re-assigned.'
expect(page.find('.triggers-list')).to have_content trigger_title expect(page.find('.triggers-list')).to have_content trigger_title
expect(page.find('.triggers-list .trigger-owner')).to have_content @user.name expect(page.find('.triggers-list .trigger-owner')).to have_content user.name
end end
end end
end end
...@@ -157,7 +157,7 @@ feature 'Triggers', feature: true, js: true do ...@@ -157,7 +157,7 @@ feature 'Triggers', feature: true, js: true do
expect(page.find('.triggers-list')).not_to have_selector('button.btn-clipboard') expect(page.find('.triggers-list')).not_to have_selector('button.btn-clipboard')
# See if trigger owner name doesn't match with current_user and trigger is non-editable # See if trigger owner name doesn't match with current_user and trigger is non-editable
expect(page.find('.triggers-list .trigger-owner')).not_to have_content @user.name expect(page.find('.triggers-list .trigger-owner')).not_to have_content user.name
expect(page.find('.triggers-list')).not_to have_selector('a[title="Edit"]') expect(page.find('.triggers-list')).not_to have_selector('a[title="Edit"]')
end end
...@@ -170,7 +170,7 @@ feature 'Triggers', feature: true, js: true do ...@@ -170,7 +170,7 @@ feature 'Triggers', feature: true, js: true do
expect(page.find('.triggers-list')).to have_selector('button.btn-clipboard') expect(page.find('.triggers-list')).to have_selector('button.btn-clipboard')
# See if trigger owner name matches with current_user and is editable # See if trigger owner name matches with current_user and is editable
expect(page.find('.triggers-list .trigger-owner')).to have_content @user.name expect(page.find('.triggers-list .trigger-owner')).to have_content user.name
expect(page.find('.triggers-list')).to have_selector('a[title="Edit"]') expect(page.find('.triggers-list')).to have_selector('a[title="Edit"]')
end end
end end
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment