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

Merged
merged 1 commit into from Sep 26, 2014

Conversation

4 participants
@cirosantilli
Contributor

cirosantilli commented Sep 24, 2014

find features/steps spec -iname '*.rb' | xargs perl -lapi -e 's/(?<=[ (])page\.(?!should)//'

I propose we forget the Hound warning for now since this is an automatic refactoring commit and manually fixing those would miss the automatic part.

Let's fix all of them on a separate refactor someday.

@TeatroIO

This comment has been minimized.

TeatroIO commented Sep 24, 2014

I've prepared a stage. Click to open.

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}")

This comment has been minimized.

@houndci-bot

houndci-bot Sep 24, 2014

Line is too long. [82/80]
Prefer single-quoted strings when you don't need string interpolation or special symbols.

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")

This comment has been minimized.

@houndci-bot

houndci-bot Sep 24, 2014

Prefer single-quoted strings when you don't need string interpolation or special symbols.

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}")
body.should have_selector("author email", text: commit.author_email)

This comment has been minimized.

@houndci-bot

houndci-bot Sep 24, 2014

Prefer single-quoted strings when you don't need string interpolation or special symbols.

response_headers['Content-Type'].should have_content("application/atom+xml")
body.should have_selector("title", text: "Recent commits to #{@project.name}")
body.should have_selector("author email", text: commit.author_email)
body.should have_selector("entry summary", text: commit.description[0..10])

This comment has been minimized.

@houndci-bot

houndci-bot Sep 24, 2014

Prefer single-quoted strings when you don't need string interpolation or special symbols.

page.execute_script('editor.setValue("GitlabFileEditor")')
page.evaluate_script('editor.getValue()').should == "GitlabFileEditor"
execute_script('editor.setValue("GitlabFileEditor")')
evaluate_script('editor.getValue()').should == "GitlabFileEditor"

This comment has been minimized.

@houndci-bot

houndci-bot Sep 24, 2014

Prefer single-quoted strings when you don't need string interpolation or special symbols.

@@ -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")

This comment has been minimized.

@houndci-bot

houndci-bot Sep 24, 2014

Prefer single-quoted strings when you don't need string interpolation or special symbols.

@@ -45,11 +45,11 @@ def check_state_steps(*ranges)
check_state_steps *Array(1..5), Array(1..2), Array(1..3), Array(1..4), Array(1..5), Array(3..5)
step 'I go back in history' do
page.evaluate_script("window.history.back()")
evaluate_script("window.history.back()")

This comment has been minimized.

@houndci-bot

houndci-bot Sep 24, 2014

Prefer single-quoted strings when you don't need string interpolation or special symbols.

end
step 'I go forward in history' do
page.evaluate_script("window.history.forward()")
evaluate_script("window.history.forward()")

This comment has been minimized.

@houndci-bot

houndci-bot Sep 24, 2014

Prefer single-quoted strings when you don't need string interpolation or special symbols.

@@ -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

This comment has been minimized.

@houndci-bot

houndci-bot Sep 24, 2014

Prefer single-quoted strings when you don't need string interpolation or special symbols.

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)

This comment has been minimized.

@houndci-bot

houndci-bot Sep 24, 2014

Line is too long. [82/80]

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}$/

This comment has been minimized.

@houndci-bot

houndci-bot Sep 24, 2014

Line is too long. [84/80]

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")

This comment has been minimized.

@houndci-bot

houndci-bot Sep 24, 2014

Line is too long. [84/80]
Prefer single-quoted strings when you don't need string interpolation or special symbols.

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")
body.should have_selector("title", text: "#{user.name} issues")

This comment has been minimized.

@houndci-bot

houndci-bot Sep 24, 2014

Prefer single-quoted strings when you don't need string interpolation or special symbols.

page.body.should have_selector("entry summary", text: issue2.title)
response_headers['Content-Type'].should have_content("application/atom+xml")
body.should have_selector("title", text: "#{user.name} issues")
body.should have_selector("author email", text: issue1.author_email)

This comment has been minimized.

@houndci-bot

houndci-bot Sep 24, 2014

Prefer single-quoted strings when you don't need string interpolation or special symbols.

response_headers['Content-Type'].should have_content("application/atom+xml")
body.should have_selector("title", text: "#{user.name} issues")
body.should have_selector("author email", text: issue1.author_email)
body.should have_selector("entry summary", text: issue1.title)

This comment has been minimized.

@houndci-bot

houndci-bot Sep 24, 2014

Prefer single-quoted strings when you don't need string interpolation or special symbols.

body.should have_selector("title", text: "#{user.name} issues")
body.should have_selector("author email", text: issue1.author_email)
body.should have_selector("entry summary", text: issue1.title)
body.should have_selector("author email", text: issue2.author_email)

This comment has been minimized.

@houndci-bot

houndci-bot Sep 24, 2014

Prefer single-quoted strings when you don't need string interpolation or special symbols.

body.should have_selector("author email", text: issue1.author_email)
body.should have_selector("entry summary", text: issue1.title)
body.should have_selector("author email", text: issue2.author_email)
body.should have_selector("entry summary", text: issue2.title)

This comment has been minimized.

@houndci-bot

houndci-bot Sep 24, 2014

Prefer single-quoted strings when you don't need string interpolation or special symbols.

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}")

This comment has been minimized.

@houndci-bot

houndci-bot Sep 24, 2014

Line is too long. [81/80]

@@ -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")

This comment has been minimized.

@houndci-bot

houndci-bot Sep 24, 2014

Prefer single-quoted strings when you don't need string interpolation or special symbols.

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")

This comment has been minimized.

@houndci-bot

houndci-bot Sep 24, 2014

Line is too long. [84/80]
Prefer single-quoted strings when you don't need string interpolation or special symbols.

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")

This comment has been minimized.

@houndci-bot

houndci-bot Sep 24, 2014

Line is too long. [84/80]
Prefer single-quoted strings when you don't need string interpolation or special symbols.

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")
body.should have_selector("title", text: "#{project.name} issues")

This comment has been minimized.

@houndci-bot

houndci-bot Sep 24, 2014

Prefer single-quoted strings when you don't need string interpolation or special symbols.

page.body.should have_selector("entry summary", text: issue.title)
response_headers['Content-Type'].should have_content("application/atom+xml")
body.should have_selector("title", text: "#{project.name} issues")
body.should have_selector("author email", text: issue.author_email)

This comment has been minimized.

@houndci-bot

houndci-bot Sep 24, 2014

Prefer single-quoted strings when you don't need string interpolation or special symbols.

response_headers['Content-Type'].should have_content("application/atom+xml")
body.should have_selector("title", text: "#{project.name} issues")
body.should have_selector("author email", text: issue.author_email)
body.should have_selector("entry summary", text: issue.title)

This comment has been minimized.

@houndci-bot

houndci-bot Sep 24, 2014

Prefer single-quoted strings when you don't need string interpolation or special symbols.

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")
body.should have_selector("title", text: "#{project.name} issues")

This comment has been minimized.

@houndci-bot

houndci-bot Sep 24, 2014

Prefer single-quoted strings when you don't need string interpolation or special symbols.

page.body.should have_selector("entry summary", text: issue.title)
response_headers['Content-Type'].should have_content("application/atom+xml")
body.should have_selector("title", text: "#{project.name} issues")
body.should have_selector("author email", text: issue.author_email)

This comment has been minimized.

@houndci-bot

houndci-bot Sep 24, 2014

Prefer single-quoted strings when you don't need string interpolation or special symbols.

response_headers['Content-Type'].should have_content("application/atom+xml")
body.should have_selector("title", text: "#{project.name} issues")
body.should have_selector("author email", text: issue.author_email)
body.should have_selector("entry summary", text: issue.title)

This comment has been minimized.

@houndci-bot

houndci-bot Sep 24, 2014

Prefer single-quoted strings when you don't need string interpolation or special symbols.

@@ -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)

This comment has been minimized.

@houndci-bot

houndci-bot Sep 24, 2014

Line is too long. [86/80]
Use the new Ruby 1.9 hash syntax.

@@ -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)

This comment has been minimized.

@houndci-bot

houndci-bot Sep 24, 2014

Use the new Ruby 1.9 hash syntax.

@@ -102,7 +102,7 @@
it "returns the latest version of the page if it exists" do
page = subject.find_page("index page")
page.title.should == "index page"
title.should == "index page"

This comment has been minimized.

@houndci-bot

houndci-bot Sep 24, 2014

Prefer single-quoted strings when you don't need string interpolation or special symbols.

@@ -111,7 +111,7 @@
it "can find a page by slug" do
page = subject.find_page("index-page")
page.title.should == "index page"
title.should == "index page"

This comment has been minimized.

@houndci-bot

houndci-bot Sep 24, 2014

Prefer single-quoted strings when you don't need string interpolation or special symbols.

@@ -21,6 +21,6 @@ def login_with(user)
# Requires Javascript driver.
def logout
page.find(:css, ".icon-signout").click
find(:css, ".icon-signout").click

This comment has been minimized.

@houndci-bot

houndci-bot Sep 24, 2014

Prefer single-quoted strings when you don't need string interpolation or special symbols.

@Razer6

This comment has been minimized.

Member

Razer6 commented Sep 24, 2014

@cirosantilli Can you look at the failing tests?

@cirosantilli cirosantilli force-pushed the cirosantilli:rm-unused-page branch from 57a0e5d to 262194d Sep 24, 2014

@@ -21,6 +21,6 @@ def login_with(user)
# Requires Javascript driver.
def logout
page.find(:css, ".icon-signout").click
find(:css, ".icon-signout").click

This comment has been minimized.

@houndci-bot

houndci-bot Sep 24, 2014

Prefer single-quoted strings when you don't need string interpolation or special symbols.

@cirosantilli

This comment has been minimized.

Contributor

cirosantilli commented Sep 24, 2014

Holy local variables called page! Should be fine now.

@Razer6

This comment has been minimized.

Member

Razer6 commented Sep 25, 2014

@cirosantilli Could you rebase, and then I'll merge the PR ASAP.

@cirosantilli cirosantilli force-pushed the cirosantilli:rm-unused-page branch from 262194d to 89f7345 Sep 26, 2014

@@ -21,6 +21,6 @@ def login_with(user)
# Requires Javascript driver.
def logout
page.find(:css, ".icon-signout").click
find(:css, ".icon-signout").click

This comment has been minimized.

@houndci-bot

houndci-bot Sep 26, 2014

Prefer single-quoted strings when you don't need string interpolation or special symbols.

@cirosantilli

This comment has been minimized.

Contributor

cirosantilli commented Sep 26, 2014

Rebased. Failures unrelated.

@Razer6

This comment has been minimized.

Member

Razer6 commented Sep 26, 2014

Thanks. Looks good!

Razer6 added a commit that referenced this pull request Sep 26, 2014

Merge pull request #7835 from cirosantilli/rm-unused-page
Remove unnecessary page. from tests.

@Razer6 Razer6 merged commit de5e0e5 into gitlabhq:master Sep 26, 2014

1 check failed

default The build failed on Semaphore.
Details
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment