fixed test using repo with commits but old factory

This commit is contained in:
Dmitriy Zaporozhets 2013-04-01 19:06:47 +03:00
parent 3b88636d3c
commit f536c13355
8 changed files with 10 additions and 19 deletions

View file

@ -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 }

View file

@ -1,7 +1,7 @@
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

View file

@ -1,8 +1,7 @@
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 }

View file

@ -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

View file

@ -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] }

View file

@ -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) }

View file

@ -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

View file

@ -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 }