Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/spec
diff options
context:
space:
mode:
authorCiro Santilli <ciro.santilli@gmail.com>2014-09-24 10:28:41 +0400
committerCiro Santilli <ciro.santilli@gmail.com>2014-09-26 11:51:17 +0400
commit89f7345f3ffdc212e60d4d657d878d1e5d6d6f9a (patch)
tree50929c127d5b45237cfbe9dd1dd26a406a7e7ed5 /spec
parent1302dc8f0420dacec65ef1dcc955763c6c263cec (diff)
Remove unnecessary page. from tests.
Diffstat (limited to 'spec')
-rw-r--r--spec/features/admin/admin_hooks_spec.rb4
-rw-r--r--spec/features/atom/dashboard_issues_spec.rb12
-rw-r--r--spec/features/atom/dashboard_spec.rb6
-rw-r--r--spec/features/atom/issues_spec.rb16
-rw-r--r--spec/features/issues_spec.rb12
-rw-r--r--spec/support/login_helpers.rb2
-rw-r--r--spec/support/matchers.rb6
-rw-r--r--spec/support/select2_helper.rb4
8 files changed, 31 insertions, 31 deletions
diff --git a/spec/features/admin/admin_hooks_spec.rb b/spec/features/admin/admin_hooks_spec.rb
index 120448ae335..b557567bd04 100644
--- a/spec/features/admin/admin_hooks_spec.rb
+++ b/spec/features/admin/admin_hooks_spec.rb
@@ -33,7 +33,7 @@ describe "Admin::Hooks", feature: true do
end
it "should open new hook popup" do
- page.current_path.should == admin_hooks_path
+ current_path.should == admin_hooks_path
page.should have_content(@url)
end
end
@@ -45,7 +45,7 @@ describe "Admin::Hooks", feature: true do
click_link "Test Hook"
end
- it { page.current_path.should == admin_hooks_path }
+ it { current_path.should == admin_hooks_path }
end
end
diff --git a/spec/features/atom/dashboard_issues_spec.rb b/spec/features/atom/dashboard_issues_spec.rb
index 9fd2933b2cc..187f2ffcffd 100644
--- a/spec/features/atom/dashboard_issues_spec.rb
+++ b/spec/features/atom/dashboard_issues_spec.rb
@@ -17,12 +17,12 @@ describe "Dashboard Issues Feed", feature: true do
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")
+ 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)
+ body.should have_selector("entry summary", text: issue2.title)
end
end
end
diff --git a/spec/features/atom/dashboard_spec.rb b/spec/features/atom/dashboard_spec.rb
index a72a41fdf39..a7f87906b2d 100644
--- a/spec/features/atom/dashboard_spec.rb
+++ b/spec/features/atom/dashboard_spec.rb
@@ -7,7 +7,7 @@ describe "Dashboard Feed", feature: true do
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")
end
end
@@ -24,11 +24,11 @@ describe "Dashboard Feed", feature: true do
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}")
end
end
end
diff --git a/spec/features/atom/issues_spec.rb b/spec/features/atom/issues_spec.rb
index 6ff03ec862c..453dca69094 100644
--- a/spec/features/atom/issues_spec.rb
+++ b/spec/features/atom/issues_spec.rb
@@ -13,10 +13,10 @@ describe "Issues Feed", feature: true do
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")
+ 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)
end
end
@@ -24,10 +24,10 @@ describe "Issues Feed", feature: true 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")
+ 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)
end
end
end
diff --git a/spec/features/issues_spec.rb b/spec/features/issues_spec.rb
index f0daf081018..26607b0090c 100644
--- a/spec/features/issues_spec.rb
+++ b/spec/features/issues_spec.rb
@@ -59,9 +59,9 @@ describe "Issues", feature: true do
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 @@ describe "Issues", feature: true do
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)
end
end
@@ -249,7 +249,7 @@ describe "Issues", feature: true do
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)
end
end
@@ -283,9 +283,9 @@ describe "Issues", feature: true do
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
diff --git a/spec/support/login_helpers.rb b/spec/support/login_helpers.rb
index 238ac7c6611..cd8a076318c 100644
--- a/spec/support/login_helpers.rb
+++ b/spec/support/login_helpers.rb
@@ -21,6 +21,6 @@ module LoginHelpers
# Requires Javascript driver.
def logout
- page.find(:css, ".icon-signout").click
+ find(:css, ".icon-signout").click
end
end
diff --git a/spec/support/matchers.rb b/spec/support/matchers.rb
index 15fb47004e9..52b11bd6323 100644
--- a/spec/support/matchers.rb
+++ b/spec/support/matchers.rb
@@ -42,19 +42,19 @@ module UrlAccess
def url_allowed?(user, url)
emulate_user(user)
visit url
- (page.status_code != 404 && current_path != new_user_session_path)
+ (status_code != 404 && current_path != new_user_session_path)
end
def url_denied?(user, url)
emulate_user(user)
visit url
- (page.status_code == 404 || current_path == new_user_session_path)
+ (status_code == 404 || current_path == new_user_session_path)
end
def url_404?(user, url)
emulate_user(user)
visit url
- page.status_code == 404
+ status_code == 404
end
def emulate_user(user)
diff --git a/spec/support/select2_helper.rb b/spec/support/select2_helper.rb
index 32c1ded2e9d..c7cf109a7bb 100644
--- a/spec/support/select2_helper.rb
+++ b/spec/support/select2_helper.rb
@@ -17,9 +17,9 @@ module Select2Helper
selector = options[:from]
if options[:multiple]
- page.execute_script("$('#{selector}').select2('val', ['#{value}']);")
+ execute_script("$('#{selector}').select2('val', ['#{value}']);")
else
- page.execute_script("$('#{selector}').select2('val', '#{value}');")
+ execute_script("$('#{selector}').select2('val', '#{value}');")
end
end
end