Commit 3cf40548 authored by Dmitriy Zaporozhets's avatar Dmitriy Zaporozhets

Merge branch 'split-up-builds' into 'master'

Split up 20min+ `spec:other` and `spinach:project` builds to increase parallelization



See merge request !2036
parents d910424c 37199719
...@@ -24,6 +24,27 @@ spec:api: ...@@ -24,6 +24,27 @@ spec:api:
- ruby - ruby
- mysql - mysql
spec:models:
script:
- RAILS_ENV=test SIMPLECOV=true bundle exec rake spec:models
tags:
- ruby
- mysql
spec:lib:
script:
- RAILS_ENV=test SIMPLECOV=true bundle exec rake spec:lib
tags:
- ruby
- mysql
spec:services:
script:
- RAILS_ENV=test SIMPLECOV=true bundle exec rake spec:services
tags:
- ruby
- mysql
spec:benchmark: spec:benchmark:
script: script:
- RAILS_ENV=test bundle exec rake spec:benchmark - RAILS_ENV=test bundle exec rake spec:benchmark
...@@ -39,9 +60,16 @@ spec:other: ...@@ -39,9 +60,16 @@ spec:other:
- ruby - ruby
- mysql - mysql
spinach:project: spinach:project:half:
script:
- RAILS_ENV=test SIMPLECOV=true bundle exec rake spinach:project:half
tags:
- ruby
- mysql
spinach:project:rest:
script: script:
- RAILS_ENV=test SIMPLECOV=true bundle exec rake spinach:project - RAILS_ENV=test SIMPLECOV=true bundle exec rake spinach:project:rest
tags: tags:
- ruby - ruby
- mysql - mysql
......
@project_commits
Feature: Project Commits Branches Feature: Project Commits Branches
Background: Background:
Given I sign in as a user Given I sign in as a user
......
@project_commits
Feature: Project Commits Comments Feature: Project Commits Comments
Background: Background:
Given I sign in as a user Given I sign in as a user
......
@project_commits
Feature: Project Commits Feature: Project Commits
Background: Background:
Given I sign in as a user Given I sign in as a user
......
@project_commits
Feature: Project Commits Diff Comments Feature: Project Commits Diff Comments
Background: Background:
Given I sign in as a user Given I sign in as a user
......
@project_commits
Feature: Project Commits Tags Feature: Project Commits Tags
Background: Background:
Given I sign in as a user Given I sign in as a user
......
@project_commits
Feature: Project Commits User Lookup Feature: Project Commits User Lookup
Background: Background:
Given I sign in as a user Given I sign in as a user
......
@project_issues
Feature: Award Emoji Feature: Award Emoji
Background: Background:
Given I sign in as a user Given I sign in as a user
......
@project_issues
Feature: Project Issues Filter Labels Feature: Project Issues Filter Labels
Background: Background:
Given I sign in as a user Given I sign in as a user
......
@project_issues
Feature: Project Issues Feature: Project Issues
Background: Background:
Given I sign in as a user Given I sign in as a user
...@@ -196,4 +197,3 @@ Feature: Project Issues ...@@ -196,4 +197,3 @@ Feature: Project Issues
And I should not see labels field And I should not see labels field
And I submit new issue "500 error on profile" And I submit new issue "500 error on profile"
Then I should see issue "500 error on profile" Then I should see issue "500 error on profile"
@project_issues
Feature: Project Issues Labels Feature: Project Issues Labels
Background: Background:
Given I sign in as a user Given I sign in as a user
......
@project_issues
Feature: Project Issues Milestones Feature: Project Issues Milestones
Background: Background:
Given I sign in as a user Given I sign in as a user
......
@project_merge_requests
Feature: Project Merge Requests Feature: Project Merge Requests
Background: Background:
Given I sign in as a user Given I sign in as a user
......
@project_merge_requests
Feature: Project Merge Requests Acceptance Feature: Project Merge Requests Acceptance
Background: Background:
Given There is an open Merge Request Given There is an open Merge Request
......
...@@ -19,6 +19,33 @@ namespace :spec do ...@@ -19,6 +19,33 @@ namespace :spec do
run_commands(cmds) run_commands(cmds)
end end
desc 'GitLab | Rspec | Run model specs'
task :models do
cmds = [
%W(rake gitlab:setup),
%W(rspec spec --tag @models)
]
run_commands(cmds)
end
desc 'GitLab | Rspec | Run service specs'
task :services do
cmds = [
%W(rake gitlab:setup),
%W(rspec spec --tag @services)
]
run_commands(cmds)
end
desc 'GitLab | Rspec | Run lib specs'
task :lib do
cmds = [
%W(rake gitlab:setup),
%W(rspec spec --tag @lib)
]
run_commands(cmds)
end
desc 'GitLab | Rspec | Run benchmark specs' desc 'GitLab | Rspec | Run benchmark specs'
task :benchmark do task :benchmark do
cmds = [ cmds = [
...@@ -32,7 +59,7 @@ namespace :spec do ...@@ -32,7 +59,7 @@ namespace :spec do
task :other do task :other do
cmds = [ cmds = [
%W(rake gitlab:setup), %W(rake gitlab:setup),
%W(rspec spec --tag ~@api --tag ~@feature --tag ~@benchmark) %W(rspec spec --tag ~@api --tag ~@feature --tag ~@models --tag ~@lib --tag ~@services --tag ~@benchmark)
] ]
run_commands(cmds) run_commands(cmds)
end end
......
Rake::Task["spinach"].clear if Rake::Task.task_defined?('spinach') Rake::Task["spinach"].clear if Rake::Task.task_defined?('spinach')
namespace :spinach do namespace :spinach do
namespace :project do
desc "GitLab | Spinach | Run project commits, issues and merge requests spinach features"
task :half do
cmds = [
%W(rake gitlab:setup),
%W(spinach --tags @project_commits,@project_issues,@project_merge_requests),
]
run_commands(cmds)
end
desc "GitLab | Spinach | Run remaining project spinach features"
task :rest do
cmds = [
%W(rake gitlab:setup),
%W(spinach --tags ~@admin,~@dashboard,~@profile,~@public,~@snippets,~@project_commits,~@project_issues,~@project_merge_requests),
]
run_commands(cmds)
end
end
desc "GitLab | Spinach | Run project spinach features" desc "GitLab | Spinach | Run project spinach features"
task :project do task :project do
cmds = [ cmds = [
%W(rake gitlab:setup), %W(rake gitlab:setup),
%W(spinach --tags ~@admin,~@dashboard,~@profile,~@public,~@snippets,~@commits), %W(spinach --tags ~@admin,~@dashboard,~@profile,~@public,~@snippets),
] ]
run_commands(cmds) run_commands(cmds)
end end
...@@ -14,7 +34,7 @@ namespace :spinach do ...@@ -14,7 +34,7 @@ namespace :spinach do
task :other do task :other do
cmds = [ cmds = [
%W(rake gitlab:setup), %W(rake gitlab:setup),
%W(spinach --tags @admin,@dashboard,@profile,@public,@snippets,@commits), %W(spinach --tags @admin,@dashboard,@profile,@public,@snippets),
] ]
run_commands(cmds) run_commands(cmds)
end end
...@@ -33,4 +53,4 @@ def run_commands(cmds) ...@@ -33,4 +53,4 @@ def run_commands(cmds)
cmds.each do |cmd| cmds.each do |cmd|
system({'RAILS_ENV' => 'test', 'force' => 'yes'}, *cmd) or raise("#{cmd} failed!") system({'RAILS_ENV' => 'test', 'force' => 'yes'}, *cmd) or raise("#{cmd} failed!")
end end
end end
\ No newline at end of file
require 'spec_helper' require 'spec_helper'
describe Ci::Ansi2html do describe Ci::Ansi2html, lib: true do
subject { Ci::Ansi2html } subject { Ci::Ansi2html }
it "prints non-ansi as-is" do it "prints non-ansi as-is" do
......
require 'spec_helper' require 'spec_helper'
describe "Charts" do describe Ci::Charts, lib: true do
context "build_times" do context "build_times" do
before do before do
......
require 'spec_helper' require 'spec_helper'
module Ci module Ci
describe GitlabCiYamlProcessor do describe GitlabCiYamlProcessor, lib: true do
let(:path) { 'path' } let(:path) { 'path' }
describe "#builds_for_ref" do describe "#builds_for_ref" do
......
require 'spec_helper' require 'spec_helper'
describe DisableEmailInterceptor do describe DisableEmailInterceptor, lib: true do
before do before do
ActionMailer::Base.register_interceptor(DisableEmailInterceptor) ActionMailer::Base.register_interceptor(DisableEmailInterceptor)
end end
......
require 'spec_helper' require 'spec_helper'
describe ExtractsPath do describe ExtractsPath, lib: true do
include ExtractsPath include ExtractsPath
include RepoHelpers include RepoHelpers
include Gitlab::Application.routes.url_helpers include Gitlab::Application.routes.url_helpers
......
require 'spec_helper' require 'spec_helper'
describe 'Gitlab::FileSizeValidatorSpec' do describe FileSizeValidator, lib: true do
let(:validator) { FileSizeValidator.new(options) } let(:validator) { FileSizeValidator.new(options) }
let(:attachment) { AttachmentUploader.new } let(:attachment) { AttachmentUploader.new }
let(:note) { create(:note) } let(:note) { create(:note) }
......
require 'spec_helper' require 'spec_helper'
describe Gitlab::GitRefValidator do describe Gitlab::GitRefValidator, lib: true do
it { expect(Gitlab::GitRefValidator.validate('feature/new')).to be_truthy } it { expect(Gitlab::GitRefValidator.validate('feature/new')).to be_truthy }
it { expect(Gitlab::GitRefValidator.validate('implement_@all')).to be_truthy } it { expect(Gitlab::GitRefValidator.validate('implement_@all')).to be_truthy }
it { expect(Gitlab::GitRefValidator.validate('my_new_feature')).to be_truthy } it { expect(Gitlab::GitRefValidator.validate('my_new_feature')).to be_truthy }
......
...@@ -2,7 +2,7 @@ require 'spec_helper' ...@@ -2,7 +2,7 @@ require 'spec_helper'
require 'nokogiri' require 'nokogiri'
module Gitlab module Gitlab
describe Asciidoc do describe Asciidoc, lib: true do
let(:input) { '<b>ascii</b>' } let(:input) { '<b>ascii</b>' }
let(:context) { {} } let(:context) { {} }
......
require 'spec_helper' require 'spec_helper'
describe Gitlab::Auth do describe Gitlab::Auth, lib: true do
let(:gl_auth) { Gitlab::Auth.new } let(:gl_auth) { Gitlab::Auth.new }
describe :find do describe :find do
......
require "spec_helper" require "spec_helper"
describe Grack::Auth do describe Grack::Auth, lib: true do
let(:user) { create(:user) } let(:user) { create(:user) }
let(:project) { create(:project) } let(:project) { create(:project) }
......
require 'spec_helper' require 'spec_helper'
describe Gitlab::Shell do describe Gitlab::Shell, lib: true do
let(:project) { double('Project', id: 7, path: 'diaspora') } let(:project) { double('Project', id: 7, path: 'diaspora') }
let(:gitlab_shell) { Gitlab::Shell.new } let(:gitlab_shell) { Gitlab::Shell.new }
...@@ -16,7 +16,7 @@ describe Gitlab::Shell do ...@@ -16,7 +16,7 @@ describe Gitlab::Shell do
it { expect(gitlab_shell.url_to_repo('diaspora')).to eq(Gitlab.config.gitlab_shell.ssh_path_prefix + "diaspora.git") } it { expect(gitlab_shell.url_to_repo('diaspora')).to eq(Gitlab.config.gitlab_shell.ssh_path_prefix + "diaspora.git") }
describe Gitlab::Shell::KeyAdder do describe Gitlab::Shell::KeyAdder, lib: true do
describe '#add_key' do describe '#add_key' do
it 'normalizes space characters in the key' do it 'normalizes space characters in the key' do
io = spy io = spy
......
require 'spec_helper' require 'spec_helper'
describe Gitlab::BitbucketImport::Client do describe Gitlab::BitbucketImport::Client, lib: true do
let(:token) { '123456' } let(:token) { '123456' }
let(:secret) { 'secret' } let(:secret) { 'secret' }
let(:client) { Gitlab::BitbucketImport::Client.new(token, secret) } let(:client) { Gitlab::BitbucketImport::Client.new(token, secret) }
......
require 'spec_helper' require 'spec_helper'
describe Gitlab::BitbucketImport::ProjectCreator do describe Gitlab::BitbucketImport::ProjectCreator, lib: true do
let(:user) { create(:user) } let(:user) { create(:user) }
let(:repo) do let(:repo) do
{ {
......
require 'spec_helper' require 'spec_helper'
describe Gitlab::ClosingIssueExtractor do describe Gitlab::ClosingIssueExtractor, lib: true do
let(:project) { create(:project) } let(:project) { create(:project) }
let(:project2) { create(:project) } let(:project2) { create(:project) }
let(:issue) { create(:issue, project: project) } let(:issue) { create(:issue, project: project) }
......
require 'spec_helper' require 'spec_helper'
describe Gitlab::ColorSchemes do describe Gitlab::ColorSchemes, lib: true do
describe '.body_classes' do describe '.body_classes' do
it 'returns a space-separated list of class names' do it 'returns a space-separated list of class names' do
css = described_class.body_classes css = described_class.body_classes
......
require 'spec_helper' require 'spec_helper'
describe Gitlab::Database do describe Gitlab::Database, lib: true do
# These are just simple smoke tests to check if the methods work (regardless # These are just simple smoke tests to check if the methods work (regardless
# of what they may return). # of what they may return).
describe '.mysql?' do describe '.mysql?' do
......
require 'spec_helper' require 'spec_helper'
describe Gitlab::Diff::File do describe Gitlab::Diff::File, lib: true do
include RepoHelpers include RepoHelpers
let(:project) { create(:project) } let(:project) { create(:project) }
......
require 'spec_helper' require 'spec_helper'
describe Gitlab::Diff::Parser do describe Gitlab::Diff::Parser, lib: true do
include RepoHelpers include RepoHelpers
let(:project) { create(:project) } let(:project) { create(:project) }
......
require "spec_helper" require "spec_helper"
describe Gitlab::Email::AttachmentUploader do describe Gitlab::Email::AttachmentUploader, lib: true do
describe "#execute" do describe "#execute" do
let(:project) { build(:project) } let(:project) { build(:project) }
let(:message_raw) { fixture_file("emails/attachment.eml") } let(:message_raw) { fixture_file("emails/attachment.eml") }
......
require "spec_helper" require "spec_helper"
describe Gitlab::Email::Receiver do describe Gitlab::Email::Receiver, lib: true do
before do before do
stub_incoming_email_setting(enabled: true, address: "reply+%{key}@appmail.adventuretime.ooo") stub_incoming_email_setting(enabled: true, address: "reply+%{key}@appmail.adventuretime.ooo")
end end
......
require "spec_helper" require "spec_helper"
# Inspired in great part by Discourse's Email::Receiver # Inspired in great part by Discourse's Email::Receiver
describe Gitlab::Email::ReplyParser do describe Gitlab::Email::ReplyParser, lib: true do
describe '#execute' do describe '#execute' do
def test_parse_body(mail_string) def test_parse_body(mail_string)
described_class.new(Mail::Message.new(mail_string)).execute described_class.new(Mail::Message.new(mail_string)).execute
......
require 'spec_helper' require 'spec_helper'
describe Gitlab::GitAccess do describe Gitlab::GitAccess, lib: true do
let(:access) { Gitlab::GitAccess.new(actor, project) } let(:access) { Gitlab::GitAccess.new(actor, project) }
let(:project) { create(:project) } let(:project) { create(:project) }
let(:user) { create(:user) } let(:user) { create(:user) }
......
require 'spec_helper' require 'spec_helper'
describe Gitlab::GitAccessWiki do describe Gitlab::GitAccessWiki, lib: true do
let(:access) { Gitlab::GitAccessWiki.new(user, project) } let(:access) { Gitlab::GitAccessWiki.new(user, project) }
let(:project) { create(:project) } let(:project) { create(:project) }
let(:user) { create(:user) } let(:user) { create(:user) }
......
require 'spec_helper' require 'spec_helper'
describe Gitlab::GithubImport::Client do describe Gitlab::GithubImport::Client, lib: true do
let(:token) { '123456' } let(:token) { '123456' }
let(:client) { Gitlab::GithubImport::Client.new(token) } let(:client) { Gitlab::GithubImport::Client.new(token) }
......
require 'spec_helper' require 'spec_helper'
describe Gitlab::GithubImport::ProjectCreator do describe Gitlab::GithubImport::ProjectCreator, lib: true do
let(:user) { create(:user) } let(:user) { create(:user) }
let(:repo) do let(:repo) do
OpenStruct.new( OpenStruct.new(
......
require 'spec_helper' require 'spec_helper'
describe Gitlab::GitlabImport::Client do describe Gitlab::GitlabImport::Client, lib: true do
let(:token) { '123456' } let(:token) { '123456' }
let(:client) { Gitlab::GitlabImport::Client.new(token) } let(:client) { Gitlab::GitlabImport::Client.new(token) }
......
require 'spec_helper' require 'spec_helper'
describe Gitlab::GitlabImport::ProjectCreator do describe Gitlab::GitlabImport::ProjectCreator, lib: true do
let(:user) { create(:user) } let(:user) { create(:user) }
let(:repo) do let(:repo) do
{ {
......
require 'spec_helper' require 'spec_helper'
describe Gitlab::GitoriousImport::ProjectCreator do describe Gitlab::GitoriousImport::ProjectCreator, lib: true do
let(:user) { create(:user) } let(:user) { create(:user) }
let(:repo) { Gitlab::GitoriousImport::Repository.new('foo/bar-baz-qux') } let(:repo) { Gitlab::GitoriousImport::Repository.new('foo/bar-baz-qux') }
let(:namespace){ create(:group, owner: user) } let(:namespace){ create(:group, owner: user) }
......
require "spec_helper" require "spec_helper"
describe Gitlab::GoogleCodeImport::Client do describe Gitlab::GoogleCodeImport::Client, lib: true do
let(:raw_data) { JSON.parse(fixture_file("GoogleCodeProjectHosting.json")) } let(:raw_data) { JSON.parse(fixture_file("GoogleCodeProjectHosting.json")) }
subject { described_class.new(raw_data) } subject { described_class.new(raw_data) }
......
require "spec_helper" require "spec_helper"
describe Gitlab::GoogleCodeImport::Importer do describe Gitlab::GoogleCodeImport::Importer, lib: true do
let(:mapped_user) { create(:user, username: "thilo123") } let(:mapped_user) { create(:user, username: "thilo123") }
let(:raw_data) { JSON.parse(fixture_file("GoogleCodeProjectHosting.json")) } let(:raw_data) { JSON.parse(fixture_file("GoogleCodeProjectHosting.json")) }
let(:client) { Gitlab::GoogleCodeImport::Client.new(raw_data) } let(:client) { Gitlab::GoogleCodeImport::Client.new(raw_data) }
......
require 'spec_helper' require 'spec_helper'
describe Gitlab::GoogleCodeImport::ProjectCreator do describe Gitlab::GoogleCodeImport::ProjectCreator, lib: true do
let(:user) { create(:user) } let(:user) { create(:user) }
let(:repo) do let(:repo) do
Gitlab::GoogleCodeImport::Repository.new( Gitlab::GoogleCodeImport::Repository.new(
......
require "spec_helper" require "spec_helper"
describe Gitlab::IncomingEmail do describe Gitlab::IncomingEmail, lib: true do
describe "self.enabled?" do describe "self.enabled?" do
context "when reply by email is enabled" do context "when reply by email is enabled" do
before do before do
......
require 'spec_helper' require 'spec_helper'
describe Gitlab::InlineDiff do describe Gitlab::InlineDiff, lib: true do
describe '#processing' do describe '#processing' do
let(:diff) do let(:diff) do
<<eos <<eos
......
require "spec_helper" require "spec_helper"
describe Gitlab::KeyFingerprint do describe Gitlab::KeyFingerprint, lib: true do
let(:key) { "ssh-rsa AAAAB3NzaC1yc2EAAAABJQAAAIEAiPWx6WM4lhHNedGfBpPJNPpZ7yKu+dnn1SJejgt4596k6YjzGGphH2TUxwKzxcKDKKezwkpfnxPkSMkuEspGRt/aZZ9wa++Oi7Qkr8prgHc4soW6NUlfDzpvZK2H5E7eQaSeP3SAwGmQKUFHCddNaP0L+hM7zhFNzjFvpaMgJw0=" } let(:key) { "ssh-rsa AAAAB3NzaC1yc2EAAAABJQAAAIEAiPWx6WM4lhHNedGfBpPJNPpZ7yKu+dnn1SJejgt4596k6YjzGGphH2TUxwKzxcKDKKezwkpfnxPkSMkuEspGRt/aZZ9wa++Oi7Qkr8prgHc4soW6NUlfDzpvZK2H5E7eQaSeP3SAwGmQKUFHCddNaP0L+hM7zhFNzjFvpaMgJw0=" }
let(:fingerprint) { "3f:a2:ee:de:b5:de:53:c3:aa:2f:9c:45:24:4c:47:7b" } let(:fingerprint) { "3f:a2:ee:de:b5:de:53:c3:aa:2f:9c:45:24:4c:47:7b" }
......
require 'spec_helper' require 'spec_helper'
describe Gitlab::LDAP::Access do describe Gitlab::LDAP::Access, lib: true do
let(:access) { Gitlab::LDAP::Access.new user } let(:access) { Gitlab::LDAP::Access.new user }
let(:user) { create(:omniauth_user) } let(:user) { create(:omniauth_user) }
......
require 'spec_helper' require 'spec_helper'
describe Gitlab::LDAP::Adapter do describe Gitlab::LDAP::Adapter, lib: true do
let(:adapter) { Gitlab::LDAP::Adapter.new 'ldapmain' } let(:adapter) { Gitlab::LDAP::Adapter.new 'ldapmain' }
describe '#dn_matches_filter?' do describe '#dn_matches_filter?' do
......
require 'spec_helper' require 'spec_helper'
describe Gitlab::LDAP::AuthHash do describe Gitlab::LDAP::AuthHash, lib: true do
let(:auth_hash) do let(:auth_hash) do
Gitlab::LDAP::AuthHash.new( Gitlab::LDAP::AuthHash.new(
OmniAuth::AuthHash.new( OmniAuth::AuthHash.new(
......
require 'spec_helper' require 'spec_helper'
describe Gitlab::LDAP::Authentication do describe Gitlab::LDAP::Authentication, lib: true do
let(:user) { create(:omniauth_user, extern_uid: dn) } let(:user) { create(:omniauth_user, extern_uid: dn) }
let(:dn) { 'uid=john,ou=people,dc=example,dc=com' } let(:dn) { 'uid=john,ou=people,dc=example,dc=com' }
let(:login) { 'john' } let(:login) { 'john' }
......
require 'spec_helper' require 'spec_helper'
describe Gitlab::LDAP::Config do describe Gitlab::LDAP::Config, lib: true do
let(:config) { Gitlab::LDAP::Config.new provider } let(:config) { Gitlab::LDAP::Config.new provider }
let(:provider) { 'ldapmain' } let(:provider) { 'ldapmain' }
......
require 'spec_helper' require 'spec_helper'
describe Gitlab::LDAP::User do describe Gitlab::LDAP::User, lib: true do
let(:ldap_user) { Gitlab::LDAP::User.new(auth_hash) } let(:ldap_user) { Gitlab::LDAP::User.new(auth_hash) }
let(:gl_user) { ldap_user.gl_user } let(:gl_user) { ldap_user.gl_user }
let(:info) do let(:info) do
......
require 'spec_helper' require 'spec_helper'
describe Gitlab::Lfs::Router do describe Gitlab::Lfs::Router, lib: true do
let(:project) { create(:project) } let(:project) { create(:project) }
let(:public_project) { create(:project, :public) } let(:public_project) { create(:project, :public) }
let(:forked_project) { fork_project(public_project, user) } let(:forked_project) { fork_project(public_project, user) }
......
require 'spec_helper' require 'spec_helper'
module Gitlab::Markdown module Gitlab::Markdown
describe AutolinkFilter do describe AutolinkFilter, lib: true do
include FilterSpecHelper include FilterSpecHelper
let(:link) { 'http://about.gitlab.com/' } let(:link) { 'http://about.gitlab.com/' }
......
require 'spec_helper' require 'spec_helper'
module Gitlab::Markdown module Gitlab::Markdown
describe CommitRangeReferenceFilter do describe CommitRangeReferenceFilter, lib: true do
include FilterSpecHelper include FilterSpecHelper
let(:project) { create(:project, :public) } let(:project) { create(:project, :public) }
......
require 'spec_helper' require 'spec_helper'
module Gitlab::Markdown module Gitlab::Markdown
describe CommitReferenceFilter do describe CommitReferenceFilter, lib: true do
include FilterSpecHelper include FilterSpecHelper
let(:project) { create(:project, :public) } let(:project) { create(:project, :public) }
......
require 'spec_helper' require 'spec_helper'
module Gitlab::Markdown module Gitlab::Markdown
describe CrossProjectReference do describe CrossProjectReference, lib: true do
include described_class include described_class
describe '#project_from_ref' do describe '#project_from_ref' do
......
require 'spec_helper' require 'spec_helper'
module Gitlab::Markdown module Gitlab::Markdown
describe EmojiFilter do describe EmojiFilter, lib: true do
include FilterSpecHelper include FilterSpecHelper
before do before do
......
require 'spec_helper' require 'spec_helper'
module Gitlab::Markdown module Gitlab::Markdown
describe ExternalIssueReferenceFilter do describe ExternalIssueReferenceFilter, lib: true do
include FilterSpecHelper include FilterSpecHelper
def helper def helper
......
require 'spec_helper' require 'spec_helper'
module Gitlab::Markdown module Gitlab::Markdown
describe ExternalLinkFilter do describe ExternalLinkFilter, lib: true do
include FilterSpecHelper include FilterSpecHelper
it 'ignores elements without an href attribute' do it 'ignores elements without an href attribute' do
......
require 'spec_helper' require 'spec_helper'
module Gitlab::Markdown module Gitlab::Markdown
describe IssueReferenceFilter do describe IssueReferenceFilter, lib: true do
include FilterSpecHelper include FilterSpecHelper
def helper def helper
......
...@@ -2,7 +2,7 @@ require 'spec_helper' ...@@ -2,7 +2,7 @@ require 'spec_helper'
require 'html/pipeline' require 'html/pipeline'
module Gitlab::Markdown module Gitlab::Markdown
describe LabelReferenceFilter do describe LabelReferenceFilter, lib: true do
include FilterSpecHelper include FilterSpecHelper
let(:project) { create(:empty_project, :public) } let(:project) { create(:empty_project, :public) }
......
require 'spec_helper' require 'spec_helper'
module Gitlab::Markdown module Gitlab::Markdown
describe MergeRequestReferenceFilter do describe MergeRequestReferenceFilter, lib: true do
include FilterSpecHelper include FilterSpecHelper
let(:project) { create(:project, :public) } let(:project) { create(:project, :public) }
......
require 'spec_helper' require 'spec_helper'
module Gitlab::Markdown module Gitlab::Markdown
describe RedactorFilter do describe RedactorFilter, lib: true do
include ActionView::Helpers::UrlHelper include ActionView::Helpers::UrlHelper
include FilterSpecHelper include FilterSpecHelper
......
require 'spec_helper' require 'spec_helper'
module Gitlab::Markdown module Gitlab::Markdown
describe ReferenceGathererFilter do describe ReferenceGathererFilter, lib: true do
include ActionView::Helpers::UrlHelper include ActionView::Helpers::UrlHelper
include FilterSpecHelper include FilterSpecHelper
......
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
require 'spec_helper' require 'spec_helper'
module Gitlab::Markdown module Gitlab::Markdown
describe RelativeLinkFilter do describe RelativeLinkFilter, lib: true do
def filter(doc, contexts = {}) def filter(doc, contexts = {})
contexts.reverse_merge!({ contexts.reverse_merge!({
commit: project.commit, commit: project.commit,
......
require 'spec_helper' require 'spec_helper'
module Gitlab::Markdown module Gitlab::Markdown
describe SanitizationFilter do describe SanitizationFilter, lib: true do
include FilterSpecHelper include FilterSpecHelper
describe 'default whitelist' do describe 'default whitelist' do
......
require 'spec_helper' require 'spec_helper'
module Gitlab::Markdown module Gitlab::Markdown
describe SnippetReferenceFilter do describe SnippetReferenceFilter, lib: true do
include FilterSpecHelper include FilterSpecHelper
let(:project) { create(:empty_project, :public) } let(:project) { create(:empty_project, :public) }
......
require 'spec_helper' require 'spec_helper'
module Gitlab::Markdown module Gitlab::Markdown
describe SyntaxHighlightFilter do describe SyntaxHighlightFilter, lib: true do
include FilterSpecHelper include FilterSpecHelper
it 'highlights valid code blocks' do it 'highlights valid code blocks' do
......
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
require 'spec_helper' require 'spec_helper'
module Gitlab::Markdown module Gitlab::Markdown
describe TableOfContentsFilter do describe TableOfContentsFilter, lib: true do
include FilterSpecHelper include FilterSpecHelper
def header(level, text) def header(level, text)
......
require 'spec_helper' require 'spec_helper'
module Gitlab::Markdown module Gitlab::Markdown
describe TaskListFilter do describe TaskListFilter, lib: true do
include FilterSpecHelper include FilterSpecHelper
it 'does not apply `task-list` class to non-task lists' do it 'does not apply `task-list` class to non-task lists' do
......
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
require 'spec_helper' require 'spec_helper'
module Gitlab::Markdown module Gitlab::Markdown
describe UploadLinkFilter do describe UploadLinkFilter, lib: true do
def filter(doc, contexts = {}) def filter(doc, contexts = {})
contexts.reverse_merge!({ contexts.reverse_merge!({
project: project project: project
......
require 'spec_helper' require 'spec_helper'
module Gitlab::Markdown module Gitlab::Markdown
describe UserReferenceFilter do describe UserReferenceFilter, lib: true do
include FilterSpecHelper include FilterSpecHelper
let(:project) { create(:empty_project, :public) } let(:project) { create(:empty_project, :public) }
......
require 'spec_helper' require 'spec_helper'
describe Gitlab::MarkupHelper do describe Gitlab::MarkupHelper, lib: true do
describe '#markup?' do describe '#markup?' do
%w(textile rdoc org creole wiki %w(textile rdoc org creole wiki
mediawiki rst adoc ad asciidoc mdown md markdown).each do |type| mediawiki rst adoc ad asciidoc mdown md markdown).each do |type|
......
require 'spec_helper' require 'spec_helper'
describe 'Gitlab::NoteDataBuilder' do describe 'Gitlab::NoteDataBuilder', lib: true do
let(:project) { create(:project) } let(:project) { create(:project) }
let(:user) { create(:user) } let(:user) { create(:user) }
let(:data) { Gitlab::NoteDataBuilder.build(note, user) } let(:data) { Gitlab::NoteDataBuilder.build(note, user) }
......
require 'spec_helper' require 'spec_helper'
describe Gitlab::OAuth::AuthHash do describe Gitlab::OAuth::AuthHash, lib: true do
let(:auth_hash) do let(:auth_hash) do
Gitlab::OAuth::AuthHash.new( Gitlab::OAuth::AuthHash.new(
OmniAuth::AuthHash.new( OmniAuth::AuthHash.new(
......
require 'spec_helper' require 'spec_helper'
describe Gitlab::OAuth::User do describe Gitlab::OAuth::User, lib: true do
let(:oauth_user) { Gitlab::OAuth::User.new(auth_hash) } let(:oauth_user) { Gitlab::OAuth::User.new(auth_hash) }
let(:gl_user) { oauth_user.gl_user } let(:gl_user) { oauth_user.gl_user }
let(:uid) { 'my-uid' } let(:uid) { 'my-uid' }
......
require 'spec_helper' require 'spec_helper'
describe 'Gitlab::Popen', no_db: true do describe 'Gitlab::Popen', lib: true, no_db: true do
let(:path) { Rails.root.join('tmp').to_s } let(:path) { Rails.root.join('tmp').to_s }
before do before do
......
require 'spec_helper' require 'spec_helper'
describe Gitlab::ProjectSearchResults do describe Gitlab::ProjectSearchResults, lib: true do
let(:project) { create(:project) } let(:project) { create(:project) }
let(:query) { 'hello world' } let(:query) { 'hello world' }
......
require 'spec_helper' require 'spec_helper'
describe 'Gitlab::PushDataBuilder' do describe 'Gitlab::PushDataBuilder', lib: true do
let(:project) { create(:project) } let(:project) { create(:project) }
let(:user) { create(:user) } let(:user) { create(:user) }
......
require 'spec_helper' require 'spec_helper'
describe Gitlab::ReferenceExtractor do describe Gitlab::ReferenceExtractor, lib: true do
let(:project) { create(:project) } let(:project) { create(:project) }
subject { Gitlab::ReferenceExtractor.new(project, project.creator) } subject { Gitlab::ReferenceExtractor.new(project, project.creator) }
......
# coding: utf-8 # coding: utf-8
require 'spec_helper' require 'spec_helper'
describe Gitlab::Regex do describe Gitlab::Regex, lib: true do
describe 'project path regex' do describe 'project path regex' do
it { expect('gitlab-ce').to match(Gitlab::Regex.project_path_regex) } it { expect('gitlab-ce').to match(Gitlab::Regex.project_path_regex) }
it { expect('gitlab_git').to match(Gitlab::Regex.project_path_regex) } it { expect('gitlab_git').to match(Gitlab::Regex.project_path_regex) }
......
require 'spec_helper' require 'spec_helper'
describe Gitlab::Sherlock::Collection do describe Gitlab::Sherlock::Collection, lib: true do
let(:collection) { described_class.new } let(:collection) { described_class.new }
let(:transaction) do let(:transaction) do
......
require 'spec_helper' require 'spec_helper'
describe Gitlab::Sherlock::FileSample do describe Gitlab::Sherlock::FileSample, lib: true do
let(:sample) { described_class.new(__FILE__, [], 150.4, 2) } let(:sample) { described_class.new(__FILE__, [], 150.4, 2) }
describe '#id' do describe '#id' do
......
require 'spec_helper' require 'spec_helper'
describe Gitlab::Sherlock::LineProfiler do describe Gitlab::Sherlock::LineProfiler, lib: true do
let(:profiler) { described_class.new } let(:profiler) { described_class.new }
describe '#profile' do describe '#profile' do
......
require 'spec_helper' require 'spec_helper'
describe Gitlab::Sherlock::LineSample do describe Gitlab::Sherlock::LineSample, lib: true do
let(:sample) { described_class.new(150.0, 4) } let(:sample) { described_class.new(150.0, 4) }
describe '#duration' do describe '#duration' do
......
require 'spec_helper' require 'spec_helper'
describe Gitlab::Sherlock::Location do describe Gitlab::Sherlock::Location, lib: true do
let(:location) { described_class.new(__FILE__, 1) } let(:location) { described_class.new(__FILE__, 1) }
describe 'from_ruby_location' do describe 'from_ruby_location' do
......
require 'spec_helper' require 'spec_helper'
describe Gitlab::Sherlock::Middleware do describe Gitlab::Sherlock::Middleware, lib: true do
let(:app) { double(:app) } let(:app) { double(:app) }
let(:middleware) { described_class.new(app) } let(:middleware) { described_class.new(app) }
......
require 'spec_helper' require 'spec_helper'
describe Gitlab::Sherlock::Query do describe Gitlab::Sherlock::Query, lib: true do
let(:started_at) { Time.utc(2015, 1, 1) } let(:started_at) { Time.utc(2015, 1, 1) }
let(:finished_at) { started_at + 5 } let(:finished_at) { started_at + 5 }
......
require 'spec_helper' require 'spec_helper'
describe Gitlab::Sherlock::Transaction do describe Gitlab::Sherlock::Transaction, lib: true do
let(:transaction) { described_class.new('POST', '/cat_pictures') } let(:transaction) { described_class.new('POST', '/cat_pictures') }
describe '#id' do describe '#id' do
......
require 'spec_helper' require 'spec_helper'
describe Gitlab::SQL::Union do describe Gitlab::SQL::Union, lib: true do
describe '#to_sql' do describe '#to_sql' do
it 'returns a String joining relations together using a UNION' do it 'returns a String joining relations together using a UNION' do
rel1 = User.where(email: 'alice@example.com') rel1 = User.where(email: 'alice@example.com')
......
require 'spec_helper' require 'spec_helper'
describe Gitlab::Themes do describe Gitlab::Themes, lib: true do
describe '.body_classes' do describe '.body_classes' do
it 'returns a space-separated list of class names' do it 'returns a space-separated list of class names' do
css = described_class.body_classes css = described_class.body_classes
......
require 'spec_helper' require 'spec_helper'
describe Gitlab::Upgrader do describe Gitlab::Upgrader, lib: true do
let(:upgrader) { Gitlab::Upgrader.new } let(:upgrader) { Gitlab::Upgrader.new }
let(:current_version) { Gitlab::VERSION } let(:current_version) { Gitlab::VERSION }
......
require 'spec_helper' require 'spec_helper'
describe Gitlab::UploadsTransfer do describe Gitlab::UploadsTransfer, lib: true do
before do before do
@root_dir = File.join(Rails.root, "public", "uploads") @root_dir = File.join(Rails.root, "public", "uploads")
@upload_transfer = Gitlab::UploadsTransfer.new @upload_transfer = Gitlab::UploadsTransfer.new
......
require 'spec_helper' require 'spec_helper'
describe Gitlab::UrlBuilder do describe Gitlab::UrlBuilder, lib: true do
describe 'When asking for an issue' do describe 'When asking for an issue' do
it 'returns the issue url' do it 'returns the issue url' do
issue = create(:issue) issue = create(:issue)
......
require 'spec_helper' require 'spec_helper'
describe 'Gitlab::VersionInfo', no_db: true do describe 'Gitlab::VersionInfo', lib: true, no_db: true do
before do before do
@unknown = Gitlab::VersionInfo.new @unknown = Gitlab::VersionInfo.new
@v0_0_1 = Gitlab::VersionInfo.new(0, 0, 1) @v0_0_1 = Gitlab::VersionInfo.new(0, 0, 1)
......
require_relative '../../lib/repository_cache' require_relative '../../lib/repository_cache'
describe RepositoryCache do describe RepositoryCache, lib: true do
let(:backend) { double('backend').as_null_object } let(:backend) { double('backend').as_null_object }
let(:cache) { RepositoryCache.new('example', backend) } let(:cache) { RepositoryCache.new('example', backend) }
......
...@@ -15,7 +15,7 @@ ...@@ -15,7 +15,7 @@
require 'spec_helper' require 'spec_helper'
describe BroadcastMessage do describe BroadcastMessage, models: true do
subject { create(:broadcast_message) } subject { create(:broadcast_message) }
it { is_expected.to be_valid } it { is_expected.to be_valid }
......
...@@ -25,7 +25,7 @@ ...@@ -25,7 +25,7 @@
require 'spec_helper' require 'spec_helper'
describe Ci::Build do describe Ci::Build, models: true do
let(:project) { FactoryGirl.create :ci_project } let(:project) { FactoryGirl.create :ci_project }
let(:gl_project) { FactoryGirl.create :empty_project, gitlab_ci_project: project } let(:gl_project) { FactoryGirl.create :empty_project, gitlab_ci_project: project }
let(:commit) { FactoryGirl.create :ci_commit, gl_project: gl_project } let(:commit) { FactoryGirl.create :ci_commit, gl_project: gl_project }
......
...@@ -18,7 +18,7 @@ ...@@ -18,7 +18,7 @@
require 'spec_helper' require 'spec_helper'
describe Ci::Commit do describe Ci::Commit, models: true do
let(:project) { FactoryGirl.create :ci_project } let(:project) { FactoryGirl.create :ci_project }
let(:gl_project) { FactoryGirl.create :empty_project, gitlab_ci_project: project } let(:gl_project) { FactoryGirl.create :empty_project, gitlab_ci_project: project }
let(:commit) { FactoryGirl.create :ci_commit, gl_project: gl_project } let(:commit) { FactoryGirl.create :ci_commit, gl_project: gl_project }
......
require 'spec_helper' require 'spec_helper'
describe Ci::HipChatMessage do describe Ci::HipChatMessage, models: true do
subject { Ci::HipChatMessage.new(build) } subject { Ci::HipChatMessage.new(build) }
let(:commit) { FactoryGirl.create(:ci_commit_with_two_jobs) } let(:commit) { FactoryGirl.create(:ci_commit_with_two_jobs) }
......
...@@ -15,7 +15,7 @@ ...@@ -15,7 +15,7 @@
require 'spec_helper' require 'spec_helper'
describe Ci::HipChatService do describe Ci::HipChatService, models: true do
describe "Validations" do describe "Validations" do
......
...@@ -14,7 +14,7 @@ ...@@ -14,7 +14,7 @@
require 'spec_helper' require 'spec_helper'
describe Ci::MailService do describe Ci::MailService, models: true do
describe "Associations" do describe "Associations" do
it { is_expected.to belong_to :project } it { is_expected.to belong_to :project }
end end
......
require 'spec_helper' require 'spec_helper'
describe Ci::SlackMessage do describe Ci::SlackMessage, models: true do
subject { Ci::SlackMessage.new(commit) } subject { Ci::SlackMessage.new(commit) }
let(:commit) { FactoryGirl.create(:ci_commit_with_two_jobs) } let(:commit) { FactoryGirl.create(:ci_commit_with_two_jobs) }
......
...@@ -14,7 +14,7 @@ ...@@ -14,7 +14,7 @@
require 'spec_helper' require 'spec_helper'
describe Ci::SlackService do describe Ci::SlackService, models: true do
describe "Associations" do describe "Associations" do
it { is_expected.to belong_to :project } it { is_expected.to belong_to :project }
end end
......
...@@ -27,7 +27,7 @@ ...@@ -27,7 +27,7 @@
require 'spec_helper' require 'spec_helper'
describe Ci::Project do describe Ci::Project, models: true do
let(:project) { FactoryGirl.create :ci_project } let(:project) { FactoryGirl.create :ci_project }
let(:gl_project) { project.gl_project } let(:gl_project) { project.gl_project }
subject { project } subject { project }
......
...@@ -11,6 +11,6 @@ ...@@ -11,6 +11,6 @@
require 'spec_helper' require 'spec_helper'
describe Ci::RunnerProject do describe Ci::RunnerProject, models: true do
pending "add some examples to (or delete) #{__FILE__}" pending "add some examples to (or delete) #{__FILE__}"
end end
...@@ -19,7 +19,7 @@ ...@@ -19,7 +19,7 @@
require 'spec_helper' require 'spec_helper'
describe Ci::Runner do describe Ci::Runner, models: true do
describe '#display_name' do describe '#display_name' do
it 'should return the description if it has a value' do it 'should return the description if it has a value' do
runner = FactoryGirl.build(:ci_runner, description: 'Linux/Ruby-1.9.3-p448') runner = FactoryGirl.build(:ci_runner, description: 'Linux/Ruby-1.9.3-p448')
......
...@@ -14,7 +14,7 @@ ...@@ -14,7 +14,7 @@
require 'spec_helper' require 'spec_helper'
describe Ci::Service do describe Ci::Service, models: true do
describe "Associations" do describe "Associations" do
it { is_expected.to belong_to :project } it { is_expected.to belong_to :project }
......
...@@ -12,7 +12,7 @@ ...@@ -12,7 +12,7 @@
require 'spec_helper' require 'spec_helper'
describe Ci::Trigger do describe Ci::Trigger, models: true do
let(:project) { FactoryGirl.create :ci_project } let(:project) { FactoryGirl.create :ci_project }
describe 'before_validation' do describe 'before_validation' do
......
...@@ -13,7 +13,7 @@ ...@@ -13,7 +13,7 @@
require 'spec_helper' require 'spec_helper'
describe Ci::Variable do describe Ci::Variable, models: true do
subject { Ci::Variable.new } subject { Ci::Variable.new }
let(:secret_value) { 'secret' } let(:secret_value) { 'secret' }
......
...@@ -11,7 +11,7 @@ ...@@ -11,7 +11,7 @@
require 'spec_helper' require 'spec_helper'
describe Ci::WebHook do describe Ci::WebHook, models: true do
describe "Associations" do describe "Associations" do
it { is_expected.to belong_to :project } it { is_expected.to belong_to :project }
end end
......
require 'spec_helper' require 'spec_helper'
describe CommitRange do describe CommitRange, models: true do
describe 'modules' do describe 'modules' do
subject { described_class } subject { described_class }
......
require 'spec_helper' require 'spec_helper'
describe Commit do describe Commit, models: true do
let(:project) { create(:project) } let(:project) { create(:project) }
let(:commit) { project.commit } let(:commit) { project.commit }
......
...@@ -33,7 +33,7 @@ ...@@ -33,7 +33,7 @@
require 'spec_helper' require 'spec_helper'
describe CommitStatus do describe CommitStatus, models: true do
let(:commit) { FactoryGirl.create :ci_commit } let(:commit) { FactoryGirl.create :ci_commit }
let(:commit_status) { FactoryGirl.create :commit_status, commit: commit } let(:commit_status) { FactoryGirl.create :commit_status, commit: commit }
......
require 'spec_helper' require 'spec_helper'
describe CaseSensitivity do describe CaseSensitivity, models: true do
describe '.iwhere' do describe '.iwhere' do
let(:connection) { ActiveRecord::Base.connection } let(:connection) { ActiveRecord::Base.connection }
let(:model) { Class.new { include CaseSensitivity } } let(:model) { Class.new { include CaseSensitivity } }
......
...@@ -15,7 +15,7 @@ ...@@ -15,7 +15,7 @@
require 'spec_helper' require 'spec_helper'
describe DeployKey do describe DeployKey, models: true do
let(:project) { create(:project) } let(:project) { create(:project) }
let(:deploy_key) { create(:deploy_key, projects: [project]) } let(:deploy_key) { create(:deploy_key, projects: [project]) }
......
...@@ -11,7 +11,7 @@ ...@@ -11,7 +11,7 @@
require 'spec_helper' require 'spec_helper'
describe DeployKeysProject do describe DeployKeysProject, models: true do
describe "Associations" do describe "Associations" do
it { is_expected.to belong_to(:deploy_key) } it { is_expected.to belong_to(:deploy_key) }
it { is_expected.to belong_to(:project) } it { is_expected.to belong_to(:project) }
......
...@@ -16,7 +16,7 @@ ...@@ -16,7 +16,7 @@
require 'spec_helper' require 'spec_helper'
describe Event do describe Event, models: true do
describe "Associations" do describe "Associations" do
it { is_expected.to belong_to(:project) } it { is_expected.to belong_to(:project) }
it { is_expected.to belong_to(:target) } it { is_expected.to belong_to(:target) }
......
require 'spec_helper' require 'spec_helper'
describe ExternalIssue do describe ExternalIssue, models: true do
let(:project) { double('project', to_reference: 'namespace1/project1') } let(:project) { double('project', to_reference: 'namespace1/project1') }
let(:issue) { described_class.new('EXT-1234', project) } let(:issue) { described_class.new('EXT-1234', project) }
......
...@@ -20,7 +20,7 @@ ...@@ -20,7 +20,7 @@
require 'spec_helper' require 'spec_helper'
describe ExternalWikiService do describe ExternalWikiService, models: true do
include ExternalWikiHelper include ExternalWikiHelper
describe "Associations" do describe "Associations" do
it { should belong_to :project } it { should belong_to :project }
......
...@@ -33,7 +33,7 @@ ...@@ -33,7 +33,7 @@
require 'spec_helper' require 'spec_helper'
describe GenericCommitStatus do describe GenericCommitStatus, models: true do
let(:commit) { FactoryGirl.create :ci_commit } let(:commit) { FactoryGirl.create :ci_commit }
let(:generic_commit_status) { FactoryGirl.create :generic_commit_status, commit: commit } let(:generic_commit_status) { FactoryGirl.create :generic_commit_status, commit: commit }
......
require 'spec_helper' require 'spec_helper'
describe GlobalMilestone do describe GlobalMilestone, models: true do
let(:user) { create(:user) } let(:user) { create(:user) }
let(:user2) { create(:user) } let(:user2) { create(:user) }
let(:group) { create(:group) } let(:group) { create(:group) }
......
...@@ -16,7 +16,7 @@ ...@@ -16,7 +16,7 @@
require 'spec_helper' require 'spec_helper'
describe Group do describe Group, models: true do
let!(:group) { create(:group) } let!(:group) { create(:group) }
describe 'associations' do describe 'associations' do
......
...@@ -18,7 +18,7 @@ ...@@ -18,7 +18,7 @@
require 'spec_helper' require 'spec_helper'
describe ProjectHook do describe ProjectHook, models: true do
describe '.push_hooks' do describe '.push_hooks' do
it 'should return hooks for push events only' do it 'should return hooks for push events only' do
hook = create(:project_hook, push_events: true) hook = create(:project_hook, push_events: true)
......
...@@ -18,7 +18,7 @@ ...@@ -18,7 +18,7 @@
require "spec_helper" require "spec_helper"
describe ServiceHook do describe ServiceHook, models: true do
describe "Associations" do describe "Associations" do
it { is_expected.to belong_to :service } it { is_expected.to belong_to :service }
end end
......
...@@ -18,7 +18,7 @@ ...@@ -18,7 +18,7 @@
require "spec_helper" require "spec_helper"
describe SystemHook do describe SystemHook, models: true do
describe "execute" do describe "execute" do
before(:each) do before(:each) do
@system_hook = create(:system_hook) @system_hook = create(:system_hook)
......
...@@ -18,7 +18,7 @@ ...@@ -18,7 +18,7 @@
require 'spec_helper' require 'spec_helper'
describe ProjectHook do describe ProjectHook, models: true do
describe "Associations" do describe "Associations" do
it { is_expected.to belong_to :project } it { is_expected.to belong_to :project }
end end
......
...@@ -20,7 +20,7 @@ ...@@ -20,7 +20,7 @@
require 'spec_helper' require 'spec_helper'
describe Issue do describe Issue, models: true do
describe "Associations" do describe "Associations" do
it { is_expected.to belong_to(:milestone) } it { is_expected.to belong_to(:milestone) }
end end
......
...@@ -15,7 +15,7 @@ ...@@ -15,7 +15,7 @@
require 'spec_helper' require 'spec_helper'
describe Key do describe Key, models: true do
describe "Associations" do describe "Associations" do
it { is_expected.to belong_to(:user) } it { is_expected.to belong_to(:user) }
end end
......
...@@ -12,7 +12,7 @@ ...@@ -12,7 +12,7 @@
require 'spec_helper' require 'spec_helper'
describe LabelLink do describe LabelLink, models: true do
let(:label) { create(:label_link) } let(:label) { create(:label_link) }
it { expect(label).to be_valid } it { expect(label).to be_valid }
......
...@@ -13,7 +13,7 @@ ...@@ -13,7 +13,7 @@
require 'spec_helper' require 'spec_helper'
describe Label do describe Label, models: true do
let(:label) { create(:label) } let(:label) { create(:label) }
describe 'associations' do describe 'associations' do
......
...@@ -19,7 +19,7 @@ ...@@ -19,7 +19,7 @@
require 'spec_helper' require 'spec_helper'
describe Member do describe Member, models: true do
describe "Associations" do describe "Associations" do
it { is_expected.to belong_to(:user) } it { is_expected.to belong_to(:user) }
end end
......
...@@ -19,7 +19,7 @@ ...@@ -19,7 +19,7 @@
require 'spec_helper' require 'spec_helper'
describe GroupMember do describe GroupMember, models: true do
context 'notification' do context 'notification' do
describe "#after_create" do describe "#after_create" do
it "should send email to user" do it "should send email to user" do
......
...@@ -19,7 +19,7 @@ ...@@ -19,7 +19,7 @@
require 'spec_helper' require 'spec_helper'
describe ProjectMember do describe ProjectMember, models: true do
describe :import_team do describe :import_team do
before do before do
@abilities = Six.new @abilities = Six.new
......
...@@ -25,7 +25,7 @@ ...@@ -25,7 +25,7 @@
require 'spec_helper' require 'spec_helper'
describe MergeRequest do describe MergeRequest, models: true do
subject { create(:merge_request) } subject { create(:merge_request) }
describe 'associations' do describe 'associations' do
......
...@@ -15,7 +15,7 @@ ...@@ -15,7 +15,7 @@
require 'spec_helper' require 'spec_helper'
describe Milestone do describe Milestone, models: true do
describe "Associations" do describe "Associations" do
it { is_expected.to belong_to(:project) } it { is_expected.to belong_to(:project) }
it { is_expected.to have_many(:issues) } it { is_expected.to have_many(:issues) }
......
...@@ -16,7 +16,7 @@ ...@@ -16,7 +16,7 @@
require 'spec_helper' require 'spec_helper'
describe Namespace do describe Namespace, models: true do
let!(:namespace) { create(:namespace) } let!(:namespace) { create(:namespace) }
it { is_expected.to have_many :projects } it { is_expected.to have_many :projects }
......
...@@ -21,7 +21,7 @@ ...@@ -21,7 +21,7 @@
require 'spec_helper' require 'spec_helper'
describe Note do describe Note, models: true do
describe 'associations' do describe 'associations' do
it { is_expected.to belong_to(:project) } it { is_expected.to belong_to(:project) }
it { is_expected.to belong_to(:noteable) } it { is_expected.to belong_to(:noteable) }
......
require 'spec_helper' require 'spec_helper'
describe Project do describe Project, models: true do
describe :authorization do describe :authorization do
before do before do
@p1 = create(:project) @p1 = create(:project)
......
...@@ -20,7 +20,7 @@ ...@@ -20,7 +20,7 @@
require 'spec_helper' require 'spec_helper'
describe BuildkiteService do describe BuildkiteService, models: true do
describe 'Associations' do describe 'Associations' do
it { is_expected.to belong_to :project } it { is_expected.to belong_to :project }
it { is_expected.to have_one :service_hook } it { is_expected.to have_one :service_hook }
......
...@@ -20,7 +20,7 @@ ...@@ -20,7 +20,7 @@
require 'spec_helper' require 'spec_helper'
describe DroneCiService do describe DroneCiService, models: true do
describe 'associations' do describe 'associations' do
it { is_expected.to belong_to(:project) } it { is_expected.to belong_to(:project) }
it { is_expected.to have_one(:service_hook) } it { is_expected.to have_one(:service_hook) }
......
...@@ -20,7 +20,7 @@ ...@@ -20,7 +20,7 @@
require 'spec_helper' require 'spec_helper'
describe FlowdockService do describe FlowdockService, models: true do
describe "Associations" do describe "Associations" do
it { is_expected.to belong_to :project } it { is_expected.to belong_to :project }
it { is_expected.to have_one :service_hook } it { is_expected.to have_one :service_hook }
......
...@@ -20,7 +20,7 @@ ...@@ -20,7 +20,7 @@
require 'spec_helper' require 'spec_helper'
describe GemnasiumService do describe GemnasiumService, models: true do
describe "Associations" do describe "Associations" do
it { is_expected.to belong_to :project } it { is_expected.to belong_to :project }
it { is_expected.to have_one :service_hook } it { is_expected.to have_one :service_hook }
......
...@@ -20,7 +20,7 @@ ...@@ -20,7 +20,7 @@
require 'spec_helper' require 'spec_helper'
describe GitlabCiService do describe GitlabCiService, models: true do
describe 'associations' do describe 'associations' do
it { is_expected.to belong_to(:project) } it { is_expected.to belong_to(:project) }
it { is_expected.to have_one(:service_hook) } it { is_expected.to have_one(:service_hook) }
......
...@@ -20,7 +20,7 @@ ...@@ -20,7 +20,7 @@
require 'spec_helper' require 'spec_helper'
describe GitlabIssueTrackerService do describe GitlabIssueTrackerService, models: true do
describe "Associations" do describe "Associations" do
it { is_expected.to belong_to :project } it { is_expected.to belong_to :project }
it { is_expected.to have_one :service_hook } it { is_expected.to have_one :service_hook }
......
...@@ -20,7 +20,7 @@ ...@@ -20,7 +20,7 @@
require 'spec_helper' require 'spec_helper'
describe HipchatService do describe HipchatService, models: true do
describe "Associations" do describe "Associations" do
it { is_expected.to belong_to :project } it { is_expected.to belong_to :project }
it { is_expected.to have_one :service_hook } it { is_expected.to have_one :service_hook }
......
...@@ -22,7 +22,7 @@ require 'spec_helper' ...@@ -22,7 +22,7 @@ require 'spec_helper'
require 'socket' require 'socket'
require 'json' require 'json'
describe IrkerService do describe IrkerService, models: true do
describe 'Associations' do describe 'Associations' do
it { is_expected.to belong_to :project } it { is_expected.to belong_to :project }
it { is_expected.to have_one :service_hook } it { is_expected.to have_one :service_hook }
......
...@@ -20,7 +20,7 @@ ...@@ -20,7 +20,7 @@
require 'spec_helper' require 'spec_helper'
describe JiraService do describe JiraService, models: true do
describe "Associations" do describe "Associations" do
it { is_expected.to belong_to :project } it { is_expected.to belong_to :project }
it { is_expected.to have_one :service_hook } it { is_expected.to have_one :service_hook }
......
...@@ -20,7 +20,7 @@ ...@@ -20,7 +20,7 @@
require 'spec_helper' require 'spec_helper'
describe PushoverService do describe PushoverService, models: true do
describe 'Associations' do describe 'Associations' do
it { is_expected.to belong_to :project } it { is_expected.to belong_to :project }
it { is_expected.to have_one :service_hook } it { is_expected.to have_one :service_hook }
......
require 'spec_helper' require 'spec_helper'
describe SlackService::IssueMessage do describe SlackService::IssueMessage, models: true do
subject { SlackService::IssueMessage.new(args) } subject { SlackService::IssueMessage.new(args) }
let(:args) do let(:args) do
......
require 'spec_helper' require 'spec_helper'
describe SlackService::MergeMessage do describe SlackService::MergeMessage, models: true do
subject { SlackService::MergeMessage.new(args) } subject { SlackService::MergeMessage.new(args) }
let(:args) do let(:args) do
......
require 'spec_helper' require 'spec_helper'
describe SlackService::NoteMessage do describe SlackService::NoteMessage, models: true do
let(:color) { '#345' } let(:color) { '#345' }
before do before do
......
require 'spec_helper' require 'spec_helper'
describe SlackService::PushMessage do describe SlackService::PushMessage, models: true do
subject { SlackService::PushMessage.new(args) } subject { SlackService::PushMessage.new(args) }
let(:args) do let(:args) do
......
...@@ -20,7 +20,7 @@ ...@@ -20,7 +20,7 @@
require 'spec_helper' require 'spec_helper'
describe SlackService do describe SlackService, models: true do
describe "Associations" do describe "Associations" do
it { is_expected.to belong_to :project } it { is_expected.to belong_to :project }
it { is_expected.to have_one :service_hook } it { is_expected.to have_one :service_hook }
......
...@@ -17,7 +17,7 @@ ...@@ -17,7 +17,7 @@
require 'spec_helper' require 'spec_helper'
describe ProjectSnippet do describe ProjectSnippet, models: true do
describe "Associations" do describe "Associations" do
it { is_expected.to belong_to(:project) } it { is_expected.to belong_to(:project) }
end end
......
...@@ -33,7 +33,7 @@ ...@@ -33,7 +33,7 @@
require 'spec_helper' require 'spec_helper'
describe Project do describe Project, models: true do
describe 'associations' do describe 'associations' do
it { is_expected.to belong_to(:group) } it { is_expected.to belong_to(:group) }
it { is_expected.to belong_to(:namespace) } it { is_expected.to belong_to(:namespace) }
......
require "spec_helper" require "spec_helper"
describe ProjectTeam do describe ProjectTeam, models: true do
let(:master) { create(:user) } let(:master) { create(:user) }
let(:reporter) { create(:user) } let(:reporter) { create(:user) }
let(:guest) { create(:user) } let(:guest) { create(:user) }
......
require "spec_helper" require "spec_helper"
describe ProjectWiki do describe ProjectWiki, models: true do
let(:project) { create(:empty_project) } let(:project) { create(:empty_project) }
let(:repository) { project.repository } let(:repository) { project.repository }
let(:user) { project.owner } let(:user) { project.owner }
......
...@@ -12,7 +12,7 @@ ...@@ -12,7 +12,7 @@
require 'spec_helper' require 'spec_helper'
describe ProtectedBranch do describe ProtectedBranch, models: true do
describe 'Associations' do describe 'Associations' do
it { is_expected.to belong_to(:project) } it { is_expected.to belong_to(:project) }
end end
......
require 'spec_helper' require 'spec_helper'
describe Repository do describe Repository, models: true do
include RepoHelpers include RepoHelpers
let(:repository) { create(:project).repository } let(:repository) { create(:project).repository }
......
...@@ -20,7 +20,7 @@ ...@@ -20,7 +20,7 @@
require 'spec_helper' require 'spec_helper'
describe Service do describe Service, models: true do
describe "Associations" do describe "Associations" do
it { is_expected.to belong_to :project } it { is_expected.to belong_to :project }
......
...@@ -17,7 +17,7 @@ ...@@ -17,7 +17,7 @@
require 'spec_helper' require 'spec_helper'
describe Snippet do describe Snippet, models: true do
describe 'modules' do describe 'modules' do
subject { described_class } subject { described_class }
......
...@@ -61,7 +61,7 @@ ...@@ -61,7 +61,7 @@
require 'spec_helper' require 'spec_helper'
describe User do describe User, models: true do
include Gitlab::CurrentSettings include Gitlab::CurrentSettings
describe 'modules' do describe 'modules' do
......
require "spec_helper" require "spec_helper"
describe WikiPage do describe WikiPage, models: true do
let(:project) { create(:empty_project) } let(:project) { create(:empty_project) }
let(:user) { project.owner } let(:user) { project.owner }
let(:wiki) { ProjectWiki.new(project, user) } let(:wiki) { ProjectWiki.new(project, user) }
......
require 'spec_helper' require 'spec_helper'
describe ArchiveRepositoryService do describe ArchiveRepositoryService, services: true do
let(:project) { create(:project) } let(:project) { create(:project) }
subject { ArchiveRepositoryService.new(project, "master", "zip") } subject { ArchiveRepositoryService.new(project, "master", "zip") }
......
require 'spec_helper' require 'spec_helper'
module Ci module Ci
describe CreateCommitService do describe CreateCommitService, services: true do
let(:service) { CreateCommitService.new } let(:service) { CreateCommitService.new }
let(:project) { FactoryGirl.create(:ci_project) } let(:project) { FactoryGirl.create(:ci_project) }
let(:user) { nil } let(:user) { nil }
......
require 'spec_helper' require 'spec_helper'
describe Ci::CreateTriggerRequestService do describe Ci::CreateTriggerRequestService, services: true do
let(:service) { Ci::CreateTriggerRequestService.new } let(:service) { Ci::CreateTriggerRequestService.new }
let(:gl_project) { create(:project) } let(:gl_project) { create(:project) }
let(:project) { gl_project.ensure_gitlab_ci_project } let(:project) { gl_project.ensure_gitlab_ci_project }
......
require 'spec_helper' require 'spec_helper'
describe Ci::EventService do describe Ci::EventService, services: true do
let(:project) { FactoryGirl.create :ci_project } let(:project) { FactoryGirl.create :ci_project }
let(:user) { double(username: "root", id: 1) } let(:user) { double(username: "root", id: 1) }
......
require 'spec_helper' require 'spec_helper'
module Ci module Ci
describe ImageForBuildService do describe ImageForBuildService, services: true do
let(:service) { ImageForBuildService.new } let(:service) { ImageForBuildService.new }
let(:project) { FactoryGirl.create(:ci_project) } let(:project) { FactoryGirl.create(:ci_project) }
let(:gl_project) { FactoryGirl.create(:project, gitlab_ci_project: project) } let(:gl_project) { FactoryGirl.create(:project, gitlab_ci_project: project) }
......
require 'spec_helper' require 'spec_helper'
module Ci module Ci
describe RegisterBuildService do describe RegisterBuildService, services: true do
let!(:service) { RegisterBuildService.new } let!(:service) { RegisterBuildService.new }
let!(:gl_project) { FactoryGirl.create :empty_project } let!(:gl_project) { FactoryGirl.create :empty_project }
let!(:commit) { FactoryGirl.create :ci_commit, gl_project: gl_project } let!(:commit) { FactoryGirl.create :ci_commit, gl_project: gl_project }
......
require 'spec_helper' require 'spec_helper'
describe Ci::WebHookService do describe Ci::WebHookService, services: true do
let(:project) { FactoryGirl.create :ci_project } let(:project) { FactoryGirl.create :ci_project }
let(:gl_project) { FactoryGirl.create :empty_project, gitlab_ci_project: project } let(:gl_project) { FactoryGirl.create :empty_project, gitlab_ci_project: project }
let(:commit) { FactoryGirl.create :ci_commit, gl_project: gl_project } let(:commit) { FactoryGirl.create :ci_commit, gl_project: gl_project }
......
require 'spec_helper' require 'spec_helper'
describe CreateReleaseService do describe CreateReleaseService, services: true do
let(:project) { create(:project) } let(:project) { create(:project) }
let(:user) { create(:user) } let(:user) { create(:user) }
let(:tag_name) { project.repository.tag_names.first } let(:tag_name) { project.repository.tag_names.first }
......
require 'spec_helper' require 'spec_helper'
describe CreateSnippetService do describe CreateSnippetService, services: true do
before do before do
@user = create :user @user = create :user
@admin = create :user, admin: true @admin = create :user, admin: true
......
require 'spec_helper' require 'spec_helper'
describe DestroyGroupService do describe DestroyGroupService, services: true do
let!(:user) { create(:user) } let!(:user) { create(:user) }
let!(:group) { create(:group) } let!(:group) { create(:group) }
let!(:project) { create(:project, namespace: group) } let!(:project) { create(:project, namespace: group) }
......
require 'spec_helper' require 'spec_helper'
describe EventCreateService do describe EventCreateService, services: true do
let(:service) { EventCreateService.new } let(:service) { EventCreateService.new }
describe 'Issues' do describe 'Issues' do
......
require 'spec_helper' require 'spec_helper'
describe GitHooksService do describe GitHooksService, services: true do
include RepoHelpers include RepoHelpers
let(:user) { create :user } let(:user) { create :user }
......
require 'spec_helper' require 'spec_helper'
describe GitPushService do describe GitPushService, services: true do
include RepoHelpers include RepoHelpers
let(:user) { create :user } let(:user) { create :user }
......
require 'spec_helper' require 'spec_helper'
describe GitTagPushService do describe GitTagPushService, services: true do
include RepoHelpers include RepoHelpers
let(:user) { create :user } let(:user) { create :user }
......
require 'spec_helper' require 'spec_helper'
describe Issues::BulkUpdateService do describe Issues::BulkUpdateService, services: true do
let(:issue) { create(:issue, project: @project) } let(:issue) { create(:issue, project: @project) }
before do before do
......
require 'spec_helper' require 'spec_helper'
describe Issues::CloseService do describe Issues::CloseService, services: true do
let(:user) { create(:user) } let(:user) { create(:user) }
let(:user2) { create(:user) } let(:user2) { create(:user) }
let(:issue) { create(:issue, assignee: user2) } let(:issue) { create(:issue, assignee: user2) }
......
require 'spec_helper' require 'spec_helper'
describe Issues::CreateService do describe Issues::CreateService, services: true do
let(:project) { create(:empty_project) } let(:project) { create(:empty_project) }
let(:user) { create(:user) } let(:user) { create(:user) }
......
require 'spec_helper' require 'spec_helper'
describe Issues::UpdateService do describe Issues::UpdateService, services: true do
let(:user) { create(:user) } let(:user) { create(:user) }
let(:user2) { create(:user) } let(:user2) { create(:user) }
let(:user3) { create(:user) } let(:user3) { create(:user) }
......
require 'spec_helper' require 'spec_helper'
describe MergeRequests::CloseService do describe MergeRequests::CloseService, services: true do
let(:user) { create(:user) } let(:user) { create(:user) }
let(:user2) { create(:user) } let(:user2) { create(:user) }
let(:merge_request) { create(:merge_request, assignee: user2) } let(:merge_request) { create(:merge_request, assignee: user2) }
......
require 'spec_helper' require 'spec_helper'
describe MergeRequests::CreateService do describe MergeRequests::CreateService, services: true do
let(:project) { create(:project) } let(:project) { create(:project) }
let(:user) { create(:user) } let(:user) { create(:user) }
......
require 'spec_helper' require 'spec_helper'
describe MergeRequests::MergeService do describe MergeRequests::MergeService, services: true do
let(:user) { create(:user) } let(:user) { create(:user) }
let(:user2) { create(:user) } let(:user2) { create(:user) }
let(:merge_request) { create(:merge_request, assignee: user2) } let(:merge_request) { create(:merge_request, assignee: user2) }
......
require 'spec_helper' require 'spec_helper'
describe MergeRequests::RefreshService do describe MergeRequests::RefreshService, services: true do
let(:project) { create(:project) } let(:project) { create(:project) }
let(:user) { create(:user) } let(:user) { create(:user) }
let(:service) { MergeRequests::RefreshService } let(:service) { MergeRequests::RefreshService }
......
require 'spec_helper' require 'spec_helper'
describe MergeRequests::ReopenService do describe MergeRequests::ReopenService, services: true do
let(:user) { create(:user) } let(:user) { create(:user) }
let(:user2) { create(:user) } let(:user2) { create(:user) }
let(:merge_request) { create(:merge_request, assignee: user2) } let(:merge_request) { create(:merge_request, assignee: user2) }
......
require 'spec_helper' require 'spec_helper'
describe MergeRequests::UpdateService do describe MergeRequests::UpdateService, services: true do
let(:user) { create(:user) } let(:user) { create(:user) }
let(:user2) { create(:user) } let(:user2) { create(:user) }
let(:user3) { create(:user) } let(:user3) { create(:user) }
......
require 'spec_helper' require 'spec_helper'
describe Milestones::CloseService do describe Milestones::CloseService, services: true do
let(:user) { create(:user) } let(:user) { create(:user) }
let(:project) { create(:project) } let(:project) { create(:project) }
let(:milestone) { create(:milestone, title: "Milestone v1.2", project: project) } let(:milestone) { create(:milestone, title: "Milestone v1.2", project: project) }
......
require 'spec_helper' require 'spec_helper'
describe Milestones::CreateService do describe Milestones::CreateService, services: true do
let(:project) { create(:empty_project) } let(:project) { create(:empty_project) }
let(:user) { create(:user) } let(:user) { create(:user) }
......
require 'spec_helper' require 'spec_helper'
describe Notes::CreateService do describe Notes::CreateService, services: true do
let(:project) { create(:empty_project) } let(:project) { create(:empty_project) }
let(:issue) { create(:issue, project: project) } let(:issue) { create(:issue, project: project) }
let(:user) { create(:user) } let(:user) { create(:user) }
......
require 'spec_helper' require 'spec_helper'
describe NotificationService do describe NotificationService, services: true do
let(:notification) { NotificationService.new } let(:notification) { NotificationService.new }
around(:each) do |example| around(:each) do |example|
......
require 'spec_helper' require 'spec_helper'
describe Projects::CreateService do describe Projects::CreateService, services: true do
describe :create_by_user do describe :create_by_user do
before do before do
@user = create :user @user = create :user
......
require 'spec_helper' require 'spec_helper'
describe Projects::DestroyService do describe Projects::DestroyService, services: true do
let!(:user) { create(:user) } let!(:user) { create(:user) }
let!(:project) { create(:project, namespace: user.namespace) } let!(:project) { create(:project, namespace: user.namespace) }
let!(:path) { project.repository.path_to_repo } let!(:path) { project.repository.path_to_repo }
......
require 'spec_helper' require 'spec_helper'
describe Projects::DownloadService do describe Projects::DownloadService, services: true do
describe 'File service' do describe 'File service' do
before do before do
@user = create :user @user = create :user
......
require 'spec_helper' require 'spec_helper'
describe Projects::ForkService do describe Projects::ForkService, services: true do
describe :fork_by_user do describe :fork_by_user do
before do before do
@from_namespace = create(:namespace) @from_namespace = create(:namespace)
......
require 'spec_helper' require 'spec_helper'
describe Projects::TransferService do describe Projects::TransferService, services: true do
let(:user) { create(:user) } let(:user) { create(:user) }
let(:group) { create(:group) } let(:group) { create(:group) }
let(:project) { create(:project, namespace: user.namespace) } let(:project) { create(:project, namespace: user.namespace) }
......
require 'spec_helper' require 'spec_helper'
describe Projects::UpdateService do describe Projects::UpdateService, services: true do
describe :update_by_user do describe :update_by_user do
before do before do
@user = create :user @user = create :user
......
require 'spec_helper' require 'spec_helper'
describe Projects::UploadService do describe Projects::UploadService, services: true do
describe 'File service' do describe 'File service' do
before do before do
@user = create :user @user = create :user
......
require 'spec_helper' require 'spec_helper'
describe 'Search::GlobalService' do describe 'Search::GlobalService', services: true do
let(:user) { create(:user) } let(:user) { create(:user) }
let(:public_user) { create(:user) } let(:public_user) { create(:user) }
let(:internal_user) { create(:user) } let(:internal_user) { create(:user) }
......
require 'spec_helper' require 'spec_helper'
describe SystemHooksService do describe SystemHooksService, services: true do
let(:user) { create :user } let(:user) { create :user }
let(:project) { create :project } let(:project) { create :project }
let(:project_member) { create :project_member } let(:project_member) { create :project_member }
......
require 'spec_helper' require 'spec_helper'
describe SystemNoteService do describe SystemNoteService, services: true do
let(:project) { create(:project) } let(:project) { create(:project) }
let(:author) { create(:user) } let(:author) { create(:user) }
let(:noteable) { create(:issue, project: project) } let(:noteable) { create(:issue, project: project) }
......
require 'spec_helper' require 'spec_helper'
describe TestHookService do describe TestHookService, services: true do
let(:user) { create :user } let(:user) { create :user }
let(:project) { create :project } let(:project) { create :project }
let(:hook) { create :project_hook, project: project } let(:hook) { create :project_hook, project: project }
......
require 'spec_helper' require 'spec_helper'
describe UpdateReleaseService do describe UpdateReleaseService, services: true do
let(:project) { create(:project) } let(:project) { create(:project) }
let(:user) { create(:user) } let(:user) { create(:user) }
let(:tag_name) { project.repository.tag_names.first } let(:tag_name) { project.repository.tag_names.first }
......
require 'spec_helper' require 'spec_helper'
describe UpdateSnippetService do describe UpdateSnippetService, services: true do
before do before do
@user = create :user @user = create :user
@admin = create :user, admin: true @admin = create :user, admin: true
......
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