Commit 1e8d703a authored by Douwe Maan's avatar Douwe Maan

Tag model specs

parent 9ebdee09
...@@ -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) }
......
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