Commit f536c133 authored by Dmitriy Zaporozhets's avatar Dmitriy Zaporozhets

fixed test using repo with commits but old factory

parent 3b88636d
...@@ -4,7 +4,7 @@ describe GitlabMarkdownHelper do ...@@ -4,7 +4,7 @@ describe GitlabMarkdownHelper do
include ApplicationHelper include ApplicationHelper
include IssuesHelper include IssuesHelper
let!(:project) { create(:project) } let!(:project) { create(:project_with_code) }
let(:user) { create(:user, username: 'gfm') } let(:user) { create(:user, username: 'gfm') }
let(:commit) { project.repository.commit } let(:commit) { project.repository.commit }
......
require "spec_helper" require "spec_helper"
describe Gitlab::Git::Commit do describe Gitlab::Git::Commit do
let(:commit) { create(:project).repository.commit } let(:commit) { create(:project_with_code).repository.commit }
describe "Commit info" do describe "Commit info" do
before do before do
...@@ -45,6 +45,5 @@ describe Gitlab::Git::Commit do ...@@ -45,6 +45,5 @@ describe Gitlab::Git::Commit do
it { should respond_to(:commits_since) } it { should respond_to(:commits_since) }
it { should respond_to(:commits_between) } it { should respond_to(:commits_between) }
it { should respond_to(:commits) } it { should respond_to(:commits) }
it { should respond_to(:compare) }
end end
end end
require "spec_helper" require "spec_helper"
describe Gitlab::Git::Repository do describe Gitlab::Git::Repository do
let(:project) { create(:project) } let(:repository) { Gitlab::Git::Repository.new('gitlabhq', 'master') }
let(:repository) { project.repository }
describe "Respond to" do describe "Respond to" do
subject { repository } subject { repository }
......
...@@ -5,7 +5,7 @@ describe Notify do ...@@ -5,7 +5,7 @@ describe Notify do
include EmailSpec::Matchers include EmailSpec::Matchers
let(:recipient) { create(:user, email: 'recipient@example.com') } let(:recipient) { create(:user, email: 'recipient@example.com') }
let(:project) { create(:project) } let(:project) { create(:project_with_code) }
shared_examples 'a multiple recipients email' do shared_examples 'a multiple recipients email' do
it 'is sent to the given recipient' do it 'is sent to the given recipient' do
...@@ -277,14 +277,7 @@ describe Notify do ...@@ -277,14 +277,7 @@ describe Notify do
end end
describe 'on a commit' do describe 'on a commit' do
let(:commit) do let(:commit) { project.repository.commit }
mock(:commit).tap do |commit|
commit.stub(:id).and_return('fauxsha1')
commit.stub(:project).and_return(project)
commit.stub(:short_id).and_return('fauxsha1')
commit.stub(:safe_message).and_return('some message')
end
end
before(:each) { note.stub(:noteable).and_return(commit) } before(:each) { note.stub(:noteable).and_return(commit) }
...@@ -297,7 +290,7 @@ describe Notify do ...@@ -297,7 +290,7 @@ describe Notify do
end end
it 'contains a link to the commit' do it 'contains a link to the commit' do
should have_body_text /fauxsha1/ should have_body_text commit.short_id
end end
end end
......
...@@ -4,7 +4,7 @@ describe Gitlab::API do ...@@ -4,7 +4,7 @@ describe Gitlab::API do
include ApiHelpers include ApiHelpers
let(:user) { create(:user ) } let(:user) { create(:user ) }
let!(:project) { create(:project, namespace: user.namespace ) } let!(:project) { create(:project_with_code, creator_id: user.id) }
let!(:merge_request) { create(:merge_request, author: user, assignee: user, project: project, title: "Test") } let!(:merge_request) { create(:merge_request, author: user, assignee: user, project: project, title: "Test") }
before { project.team << [user, :reporters] } before { project.team << [user, :reporters] }
......
...@@ -7,7 +7,7 @@ describe Gitlab::API do ...@@ -7,7 +7,7 @@ describe Gitlab::API do
let(:user2) { create(:user) } let(:user2) { create(:user) }
let(:user3) { create(:user) } let(:user3) { create(:user) }
let(:admin) { create(:admin) } let(:admin) { create(:admin) }
let!(:project) { create(:project, namespace: user.namespace ) } let!(:project) { create(:project_with_code, creator_id: user.id) }
let!(:hook) { create(:project_hook, project: project, url: "http://example.com") } let!(:hook) { create(:project_hook, project: project, url: "http://example.com") }
let!(:snippet) { create(:snippet, author: user, project: project, title: 'example') } let!(:snippet) { create(:snippet, author: user, project: project, title: 'example') }
let!(:users_project) { create(:users_project, user: user, project: project, project_access: UsersProject::MASTER) } let!(:users_project) { create(:users_project, user: user, project: project, project_access: UsersProject::MASTER) }
......
...@@ -2,7 +2,7 @@ require 'spec_helper' ...@@ -2,7 +2,7 @@ require 'spec_helper'
describe GitPushService do describe GitPushService do
let (:user) { create :user } let (:user) { create :user }
let (:project) { create :project } let (:project) { create :project_with_code }
let (:service) { GitPushService.new } let (:service) { GitPushService.new }
before do before do
......
...@@ -9,7 +9,7 @@ describe PostReceive do ...@@ -9,7 +9,7 @@ describe PostReceive do
end end
context "web hook" do context "web hook" do
let(:project) { create(:project) } let(:project) { create(:project_with_code) }
let(:key) { create(:key, user: project.owner) } let(:key) { create(:key, user: project.owner) }
let(:key_id) { key.shell_id } let(:key_id) { key.shell_id }
......
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