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