-
Notifications
You must be signed in to change notification settings - Fork 5.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Remove unnecessary page. from tests. #7835
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -17,10 +17,10 @@ class Spinach::Features::ProjectBrowseCommits < Spinach::FeatureSteps | |
|
||
step 'I see commits atom feed' do | ||
commit = @project.repository.commit | ||
page.response_headers['Content-Type'].should have_content("application/atom+xml") | ||
page.body.should have_selector("title", text: "Recent commits to #{@project.name}") | ||
page.body.should have_selector("author email", text: commit.author_email) | ||
page.body.should have_selector("entry summary", text: commit.description[0..10]) | ||
response_headers['Content-Type'].should have_content("application/atom+xml") | ||
body.should have_selector("title", text: "Recent commits to #{@project.name}") | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Line is too long. [82/80] |
||
body.should have_selector("author email", text: commit.author_email) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Prefer single-quoted strings when you don't need string interpolation or special symbols. |
||
body.should have_selector("entry summary", text: commit.description[0..10]) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Prefer single-quoted strings when you don't need string interpolation or special symbols. |
||
end | ||
|
||
step 'I click on commit link' do | ||
|
@@ -72,7 +72,7 @@ class Spinach::Features::ProjectBrowseCommits < Spinach::FeatureSteps | |
end | ||
|
||
step 'The diff links to both the previous and current image' do | ||
links = page.all('.two-up span div a') | ||
links = all('.two-up span div a') | ||
links[0]['href'].should =~ %r{blob/#{sample_image_commit.old_blob_id}} | ||
links[1]['href'].should =~ %r{blob/#{sample_image_commit.new_blob_id}} | ||
end | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -29,20 +29,20 @@ class Spinach::Features::ProjectBrowseFiles < Spinach::FeatureSteps | |
end | ||
|
||
step 'I should see raw file content' do | ||
page.source.should == sample_blob.data | ||
source.should == sample_blob.data | ||
end | ||
|
||
step 'I click button "edit"' do | ||
click_link 'edit' | ||
end | ||
|
||
step 'I can edit code' do | ||
page.execute_script('editor.setValue("GitlabFileEditor")') | ||
page.evaluate_script('editor.getValue()').should == "GitlabFileEditor" | ||
execute_script('editor.setValue("GitlabFileEditor")') | ||
evaluate_script('editor.getValue()').should == "GitlabFileEditor" | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Prefer single-quoted strings when you don't need string interpolation or special symbols. |
||
end | ||
|
||
step 'I edit code' do | ||
page.execute_script('editor.setValue("GitlabFileEditor")') | ||
execute_script('editor.setValue("GitlabFileEditor")') | ||
end | ||
|
||
step 'I click link "Diff"' do | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -113,7 +113,7 @@ class Spinach::Features::ProjectIssues < Spinach::FeatureSteps | |
|
||
step 'I should see selected milestone with title "v3.0"' do | ||
issues_milestone_selector = "#issue_milestone_id_chzn > a" | ||
page.find(issues_milestone_selector).should have_content("v3.0") | ||
find(issues_milestone_selector).should have_content("v3.0") | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Prefer single-quoted strings when you don't need string interpolation or special symbols. |
||
end | ||
|
||
When 'I select first assignee from "Shop" project' do | ||
|
@@ -126,7 +126,7 @@ class Spinach::Features::ProjectIssues < Spinach::FeatureSteps | |
issues_assignee_selector = "#issue_assignee_id_chzn > a" | ||
|
||
assignee_name = project.users.first.name | ||
page.find(issues_assignee_selector).should have_content(assignee_name) | ||
find(issues_assignee_selector).should have_content(assignee_name) | ||
end | ||
|
||
step 'project "Shop" have "Release 0.4" open issue' do | ||
|
@@ -164,7 +164,7 @@ class Spinach::Features::ProjectIssues < Spinach::FeatureSteps | |
|
||
step 'I see empty project details with ssh clone info' do | ||
project = Project.find_by(name: 'Empty Project') | ||
page.all(:css, '.git-empty .clone').each do |element| | ||
all(:css, '.git-empty .clone').each do |element| | ||
element.text.should include(project.url_to_repo) | ||
end | ||
end | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -22,7 +22,7 @@ class Spinach::Features::ProjectStar < Spinach::FeatureSteps | |
|
||
# Requires @javascript | ||
step "I click on the star toggle button" do | ||
page.find(".star .toggle", visible: true).click | ||
find(".star .toggle", visible: true).click | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Prefer single-quoted strings when you don't need string interpolation or special symbols. |
||
end | ||
|
||
protected | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,15 +2,15 @@ module SharedActiveTab | |
include Spinach::DSL | ||
|
||
def ensure_active_main_tab(content) | ||
page.find('.main-nav li.active').should have_content(content) | ||
find('.main-nav li.active').should have_content(content) | ||
end | ||
|
||
def ensure_active_sub_tab(content) | ||
page.find('div.content ul.nav-tabs li.active').should have_content(content) | ||
find('div.content ul.nav-tabs li.active').should have_content(content) | ||
end | ||
|
||
def ensure_active_sub_nav(content) | ||
page.find('div.content ul.nav-stacked-menu li.active').should have_content(content) | ||
find('div.content ul.nav-stacked-menu li.active').should have_content(content) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Line is too long. [82/80] |
||
end | ||
|
||
step 'no other main tabs should be active' do | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,8 +2,8 @@ module SharedMarkdown | |
include Spinach::DSL | ||
|
||
def header_should_have_correct_id_and_link(level, text, id, parent = ".wiki") | ||
page.find(:css, "#{parent} h#{level}##{id}").text.should == text | ||
page.find(:css, "#{parent} h#{level}##{id} > :last-child")[:href].should =~ /##{id}$/ | ||
find(:css, "#{parent} h#{level}##{id}").text.should == text | ||
find(:css, "#{parent} h#{level}##{id} > :last-child")[:href].should =~ /##{id}$/ | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Line is too long. [84/80] |
||
end | ||
|
||
step 'Header "Description header" should have correct id and link' do | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -17,12 +17,12 @@ | |
it "should render atom feed via private token" do | ||
visit issues_dashboard_path(:atom, private_token: user.private_token) | ||
|
||
page.response_headers['Content-Type'].should have_content("application/atom+xml") | ||
page.body.should have_selector("title", text: "#{user.name} issues") | ||
page.body.should have_selector("author email", text: issue1.author_email) | ||
page.body.should have_selector("entry summary", text: issue1.title) | ||
page.body.should have_selector("author email", text: issue2.author_email) | ||
page.body.should have_selector("entry summary", text: issue2.title) | ||
response_headers['Content-Type'].should have_content("application/atom+xml") | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Line is too long. [84/80] |
||
body.should have_selector("title", text: "#{user.name} issues") | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Prefer single-quoted strings when you don't need string interpolation or special symbols. |
||
body.should have_selector("author email", text: issue1.author_email) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Prefer single-quoted strings when you don't need string interpolation or special symbols. |
||
body.should have_selector("entry summary", text: issue1.title) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Prefer single-quoted strings when you don't need string interpolation or special symbols. |
||
body.should have_selector("author email", text: issue2.author_email) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Prefer single-quoted strings when you don't need string interpolation or special symbols. |
||
body.should have_selector("entry summary", text: issue2.title) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Prefer single-quoted strings when you don't need string interpolation or special symbols. |
||
end | ||
end | ||
end | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -7,7 +7,7 @@ | |
context "projects atom feed via private token" do | ||
it "should render projects atom feed" do | ||
visit dashboard_path(:atom, private_token: user.private_token) | ||
page.body.should have_selector("feed title") | ||
body.should have_selector("feed title") | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Prefer single-quoted strings when you don't need string interpolation or special symbols. |
||
end | ||
end | ||
|
||
|
@@ -24,11 +24,11 @@ | |
end | ||
|
||
it "should have issue opened event" do | ||
page.body.should have_content("#{user.name} opened issue ##{issue.iid}") | ||
body.should have_content("#{user.name} opened issue ##{issue.iid}") | ||
end | ||
|
||
it "should have issue comment event" do | ||
page.body.should have_content("#{user.name} commented on issue ##{issue.iid}") | ||
body.should have_content("#{user.name} commented on issue ##{issue.iid}") | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Line is too long. [81/80] |
||
end | ||
end | ||
end | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -13,21 +13,21 @@ | |
login_with user | ||
visit project_issues_path(project, :atom) | ||
|
||
page.response_headers['Content-Type'].should have_content("application/atom+xml") | ||
page.body.should have_selector("title", text: "#{project.name} issues") | ||
page.body.should have_selector("author email", text: issue.author_email) | ||
page.body.should have_selector("entry summary", text: issue.title) | ||
response_headers['Content-Type'].should have_content("application/atom+xml") | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Line is too long. [84/80] |
||
body.should have_selector("title", text: "#{project.name} issues") | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Prefer single-quoted strings when you don't need string interpolation or special symbols. |
||
body.should have_selector("author email", text: issue.author_email) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Prefer single-quoted strings when you don't need string interpolation or special symbols. |
||
body.should have_selector("entry summary", text: issue.title) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Prefer single-quoted strings when you don't need string interpolation or special symbols. |
||
end | ||
end | ||
|
||
context "when authenticated via private token" do | ||
it "should render atom feed" do | ||
visit project_issues_path(project, :atom, private_token: user.private_token) | ||
|
||
page.response_headers['Content-Type'].should have_content("application/atom+xml") | ||
page.body.should have_selector("title", text: "#{project.name} issues") | ||
page.body.should have_selector("author email", text: issue.author_email) | ||
page.body.should have_selector("entry summary", text: issue.title) | ||
response_headers['Content-Type'].should have_content("application/atom+xml") | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Line is too long. [84/80] |
||
body.should have_selector("title", text: "#{project.name} issues") | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Prefer single-quoted strings when you don't need string interpolation or special symbols. |
||
body.should have_selector("author email", text: issue.author_email) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Prefer single-quoted strings when you don't need string interpolation or special symbols. |
||
body.should have_selector("entry summary", text: issue.title) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Prefer single-quoted strings when you don't need string interpolation or special symbols. |
||
end | ||
end | ||
end | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -59,9 +59,9 @@ | |
|
||
page.should have_content "Assign to #{@user.name}" | ||
|
||
page.first('#s2id_issue_assignee_id').click | ||
first('#s2id_issue_assignee_id').click | ||
sleep 2 # wait for ajax stuff to complete | ||
page.first('.user-result').click | ||
first('.user-result').click | ||
|
||
click_button "Save changes" | ||
|
||
|
@@ -212,7 +212,7 @@ | |
click_button 'Update Issue' | ||
|
||
page.should have_content "Assignee:" | ||
page.has_select?('issue_assignee_id', :selected => project.team.members.first.name) | ||
has_select?('issue_assignee_id', :selected => project.team.members.first.name) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Line is too long. [86/80] |
||
end | ||
end | ||
|
||
|
@@ -249,7 +249,7 @@ | |
click_button 'Update Issue' | ||
|
||
page.should have_content "Milestone changed to #{milestone.title}" | ||
page.has_select?('issue_assignee_id', :selected => milestone.title) | ||
has_select?('issue_assignee_id', :selected => milestone.title) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Use the new Ruby 1.9 hash syntax. |
||
end | ||
end | ||
|
||
|
@@ -283,9 +283,9 @@ | |
visit project_issue_path(project, issue) | ||
page.should have_content "Assignee: #{user2.name}" | ||
|
||
page.first('#s2id_issue_assignee_id').click | ||
first('#s2id_issue_assignee_id').click | ||
sleep 2 # wait for ajax stuff to complete | ||
page.first('.user-result').click | ||
first('.user-result').click | ||
|
||
page.should have_content "Assignee: Unassigned" | ||
sleep 2 # wait for ajax stuff to complete | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -21,6 +21,6 @@ def login_with(user) | |
|
||
# Requires Javascript driver. | ||
def logout | ||
page.find(:css, ".icon-signout").click | ||
find(:css, ".icon-signout").click | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Prefer single-quoted strings when you don't need string interpolation or special symbols. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Prefer single-quoted strings when you don't need string interpolation or special symbols. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Prefer single-quoted strings when you don't need string interpolation or special symbols. |
||
end | ||
end |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Prefer single-quoted strings when you don't need string interpolation or special symbols.