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
diff options
context:
space:
mode:
authorJames Lopez <james@jameslopez.es>2016-06-03 12:10:17 +0300
committerJames Lopez <james@jameslopez.es>2016-06-03 12:10:17 +0300
commit721014c92799219d357b1b7c971d4c0b6050ff2a (patch)
tree5d388628addcd77a096a336bcd6240c2058e331e /spec/support
parent3e99123095b26988de67a94b0e7a5207c1ef5ae2 (diff)
Revert "Fix merge conflicts - squashed commit"
This reverts commit 3e99123095b26988de67a94b0e7a5207c1ef5ae2.
Diffstat (limited to 'spec/support')
-rw-r--r--spec/support/filter_spec_helper.rb3
-rw-r--r--spec/support/jira_service_helper.rb10
-rw-r--r--spec/support/login_helpers.rb6
-rw-r--r--spec/support/markdown_feature.rb6
-rw-r--r--spec/support/matchers/markdown_matchers.rb12
-rw-r--r--spec/support/reference_parser_helpers.rb5
-rw-r--r--spec/support/stub_gitlab_calls.rb37
7 files changed, 21 insertions, 58 deletions
diff --git a/spec/support/filter_spec_helper.rb b/spec/support/filter_spec_helper.rb
index a8e454eb09e..e849a9633b9 100644
--- a/spec/support/filter_spec_helper.rb
+++ b/spec/support/filter_spec_helper.rb
@@ -40,7 +40,8 @@ module FilterSpecHelper
filters = [
Banzai::Filter::AutolinkFilter,
- described_class
+ described_class,
+ Banzai::Filter::ReferenceGathererFilter
]
HTML::Pipeline.new(filters, context)
diff --git a/spec/support/jira_service_helper.rb b/spec/support/jira_service_helper.rb
index 5ebe095743b..a3f496359b1 100644
--- a/spec/support/jira_service_helper.rb
+++ b/spec/support/jira_service_helper.rb
@@ -2,11 +2,11 @@ module JiraServiceHelper
def jira_service_settings
properties = {
- "title" => "JIRA tracker",
- "project_url" => "http://jira.example/issues/?jql=project=A",
- "issues_url" => "http://jira.example/browse/JIRA-1",
- "new_issue_url" => "http://jira.example/secure/CreateIssue.jspa",
- "api_url" => "http://jira.example/rest/api/2"
+ "title"=>"JIRA tracker",
+ "project_url"=>"http://jira.example/issues/?jql=project=A",
+ "issues_url"=>"http://jira.example/browse/JIRA-1",
+ "new_issue_url"=>"http://jira.example/secure/CreateIssue.jspa",
+ "api_url"=>"http://jira.example/rest/api/2"
}
jira_tracker.update_attributes(properties: properties, active: true)
diff --git a/spec/support/login_helpers.rb b/spec/support/login_helpers.rb
index 7a0f078c72b..cd9fdc6f18e 100644
--- a/spec/support/login_helpers.rb
+++ b/spec/support/login_helpers.rb
@@ -26,13 +26,11 @@ module LoginHelpers
# Internal: Login as the specified user
#
- # user - User instance to login with
- # remember - Whether or not to check "Remember me" (default: false)
- def login_with(user, remember: false)
+ # user - User instance to login with
+ def login_with(user)
visit new_user_session_path
fill_in "user_login", with: user.email
fill_in "user_password", with: "12345678"
- check 'user_remember_me' if remember
click_button "Sign in"
Thread.current[:current_user] = user
end
diff --git a/spec/support/markdown_feature.rb b/spec/support/markdown_feature.rb
index 7fc6d6fcc5e..b87cd6bbca2 100644
--- a/spec/support/markdown_feature.rb
+++ b/spec/support/markdown_feature.rb
@@ -63,12 +63,8 @@ class MarkdownFeature
@label ||= create(:label, name: 'awaiting feedback', project: project)
end
- def simple_milestone
- @simple_milestone ||= create(:milestone, name: 'gfm-milestone', project: project)
- end
-
def milestone
- @milestone ||= create(:milestone, name: 'next goal', project: project)
+ @milestone ||= create(:milestone, project: project)
end
# Cross-references -----------------------------------------------------------
diff --git a/spec/support/matchers/markdown_matchers.rb b/spec/support/matchers/markdown_matchers.rb
index e005058ba5b..43cb6ef43f2 100644
--- a/spec/support/matchers/markdown_matchers.rb
+++ b/spec/support/matchers/markdown_matchers.rb
@@ -154,7 +154,7 @@ module MarkdownMatchers
set_default_markdown_messages
match do |actual|
- expect(actual).to have_selector('a.gfm.gfm-milestone', count: 6)
+ expect(actual).to have_selector('a.gfm.gfm-milestone', count: 3)
end
end
@@ -168,16 +168,6 @@ module MarkdownMatchers
expect(actual).to have_selector('input[checked]', count: 3)
end
end
-
- # InlineDiffFilter
- matcher :parse_inline_diffs do
- set_default_markdown_messages
-
- match do |actual|
- expect(actual).to have_selector('span.idiff.addition', count: 2)
- expect(actual).to have_selector('span.idiff.deletion', count: 2)
- end
- end
end
# Monkeypatch the matcher DSL so that we can reduce some noisy duplication for
diff --git a/spec/support/reference_parser_helpers.rb b/spec/support/reference_parser_helpers.rb
deleted file mode 100644
index 01689194eac..00000000000
--- a/spec/support/reference_parser_helpers.rb
+++ /dev/null
@@ -1,5 +0,0 @@
-module ReferenceParserHelpers
- def empty_html_link
- Nokogiri::HTML.fragment('<a></a>').children[0]
- end
-end
diff --git a/spec/support/stub_gitlab_calls.rb b/spec/support/stub_gitlab_calls.rb
index f73416a3d0f..eec2e681117 100644
--- a/spec/support/stub_gitlab_calls.rb
+++ b/spec/support/stub_gitlab_calls.rb
@@ -25,23 +25,6 @@ module StubGitlabCalls
allow_any_instance_of(Project).to receive(:builds_enabled?).and_return(false)
end
- def stub_container_registry_config(registry_settings)
- allow(Gitlab.config.registry).to receive_messages(registry_settings)
- allow(Auth::ContainerRegistryAuthenticationService).to receive(:full_access_token).and_return('token')
- end
-
- def stub_container_registry_tags(*tags)
- allow_any_instance_of(ContainerRegistry::Client).to receive(:repository_tags).and_return(
- { "tags" => tags }
- )
- allow_any_instance_of(ContainerRegistry::Client).to receive(:repository_manifest).and_return(
- JSON.load(File.read(Rails.root + 'spec/fixtures/container_registry/tag_manifest.json'))
- )
- allow_any_instance_of(ContainerRegistry::Client).to receive(:blob).and_return(
- File.read(Rails.root + 'spec/fixtures/container_registry/config_blob.json')
- )
- end
-
private
def gitlab_url
@@ -53,20 +36,20 @@ module StubGitlabCalls
stub_request(:post, "#{gitlab_url}api/v3/session.json").
with(body: "{\"email\":\"test@test.com\",\"password\":\"123456\"}",
- headers: { 'Content-Type' => 'application/json' }).
- to_return(status: 201, body: f, headers: { 'Content-Type' => 'application/json' })
+ headers: { 'Content-Type'=>'application/json' }).
+ to_return(status: 201, body: f, headers: { 'Content-Type'=>'application/json' })
end
def stub_user
f = File.read(Rails.root.join('spec/support/gitlab_stubs/user.json'))
stub_request(:get, "#{gitlab_url}api/v3/user?private_token=Wvjy2Krpb7y8xi93owUz").
- with(headers: { 'Content-Type' => 'application/json' }).
- to_return(status: 200, body: f, headers: { 'Content-Type' => 'application/json' })
+ with(headers: { 'Content-Type'=>'application/json' }).
+ to_return(status: 200, body: f, headers: { 'Content-Type'=>'application/json' })
stub_request(:get, "#{gitlab_url}api/v3/user?access_token=some_token").
- with(headers: { 'Content-Type' => 'application/json' }).
- to_return(status: 200, body: f, headers: { 'Content-Type' => 'application/json' })
+ with(headers: { 'Content-Type'=>'application/json' }).
+ to_return(status: 200, body: f, headers: { 'Content-Type'=>'application/json' })
end
def stub_project_8
@@ -83,19 +66,19 @@ module StubGitlabCalls
f = File.read(Rails.root.join('spec/support/gitlab_stubs/projects.json'))
stub_request(:get, "#{gitlab_url}api/v3/projects.json?archived=false&ci_enabled_first=true&private_token=Wvjy2Krpb7y8xi93owUz").
- with(headers: { 'Content-Type' => 'application/json' }).
- to_return(status: 200, body: f, headers: { 'Content-Type' => 'application/json' })
+ with(headers: { 'Content-Type'=>'application/json' }).
+ to_return(status: 200, body: f, headers: { 'Content-Type'=>'application/json' })
end
def stub_projects_owned
stub_request(:get, "#{gitlab_url}api/v3/projects/owned.json?archived=false&ci_enabled_first=true&private_token=Wvjy2Krpb7y8xi93owUz").
- with(headers: { 'Content-Type' => 'application/json' }).
+ with(headers: { 'Content-Type'=>'application/json' }).
to_return(status: 200, body: "", headers: {})
end
def stub_ci_enable
stub_request(:put, "#{gitlab_url}api/v3/projects/2/services/gitlab-ci.json?private_token=Wvjy2Krpb7y8xi93owUz").
- with(headers: { 'Content-Type' => 'application/json' }).
+ with(headers: { 'Content-Type'=>'application/json' }).
to_return(status: 200, body: "", headers: {})
end