Commit 245e10a3 authored by Walmyr Lima's avatar Walmyr Lima

Update new test to use let variables

By using let instead of instance variables we follow what is des-
cribed in our testing best practices.
parent e2542994
......@@ -9,34 +9,38 @@ module QA
end
end
before do
Runtime::Browser.visit(:gitlab, Page::Main::Login)
Page::Main::Login.perform(&:sign_in_using_credentials)
@issue_1 = Resource::Issue.fabricate_via_api! do |issue|
let(:issue_1) do
Resource::Issue.fabricate_via_api! do |issue|
issue.project = project
issue.title = 'Issue 1'
end
end
@issue_2 = Resource::Issue.fabricate_via_api! do |issue|
let(:issue_2) do
Resource::Issue.fabricate_via_api! do |issue|
issue.project = project
issue.title = 'Issue 2'
end
end
before do
Runtime::Browser.visit(:gitlab, Page::Main::Login)
Page::Main::Login.perform(&:sign_in_using_credentials)
end
it 'relates and unrelates one issue to/from another' do
@issue_1.visit!
issue_1.visit!
Page::Project::Issue::Show.perform do |show|
show.relate_issue(@issue_2)
show.relate_issue(issue_2)
expect(show).to have_content("marked this issue as related to ##{@issue_2.iid}")
expect(show.related_issuable_item).to have_content(@issue_2.title)
expect(show).to have_content("marked this issue as related to ##{issue_2.iid}")
expect(show.related_issuable_item).to have_content(issue_2.title)
show.click_remove_issue_button
expect(show).to have_content("removed the relation with ##{@issue_2.iid}")
expect(show).not_to have_content(@issue_2.title)
expect(show).to have_content("removed the relation with ##{issue_2.iid}")
expect(show).not_to have_content(issue_2.title)
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