Update specs
This commit is contained in:
parent
db4d1ba457
commit
52609f43b5
|
@ -468,7 +468,7 @@ describe Api::V1::BuildListsController, type: :controller do
|
|||
|
||||
context "do reject_publish" do
|
||||
before do
|
||||
any_instance_of(BuildList, current_duration: 100)
|
||||
allow_any_instance_of(BuildList).to receive(:current_duration).and_return(100)
|
||||
@build_list.save_to_repository.update_column(:publish_without_qa, false)
|
||||
end
|
||||
|
||||
|
@ -636,7 +636,7 @@ describe Api::V1::BuildListsController, type: :controller do
|
|||
# Create and show params:
|
||||
@create_params = {build_list: @build_list.attributes.symbolize_keys}
|
||||
@create_params = @create_params.merge(arches: [@params[:arch_id]], build_for_platform_id: @platform.id, format: :json)
|
||||
any_instance_of(Project, versions: ['v1.0', 'v2.0'])
|
||||
allow_any_instance_of(Project).to receive(:versions).and_return(%w(v1.0 v2.0))
|
||||
|
||||
# Groups:
|
||||
@owner_group = FactoryGirl.create(:group, owner: @owner_user)
|
||||
|
|
|
@ -3,7 +3,7 @@ require 'spec_helper'
|
|||
describe Api::V1::IssuesController, type: :controller do
|
||||
before do
|
||||
stub_symlink_methods
|
||||
any_instance_of(Project, versions: ['v1.0', 'v2.0'])
|
||||
allow_any_instance_of(Project).to receive(:versions).and_return(%w(v1.0 v2.0))
|
||||
|
||||
@project = FactoryGirl.create(:project_with_commit)
|
||||
@issue = FactoryGirl.create(:issue, project: @project)
|
||||
|
|
|
@ -92,7 +92,7 @@ describe Projects::BuildListsController, type: :controller do
|
|||
arches: [FactoryGirl.create(:arch).id],
|
||||
build_for_platforms: [@platform.id]
|
||||
}
|
||||
any_instance_of(Project, versions: ['v1.0', 'v2.0'])
|
||||
allow_any_instance_of(Project).to receive(:versions).and_return(%w(v1.0 v2.0))
|
||||
end
|
||||
|
||||
context 'for guest' do
|
||||
|
@ -110,7 +110,7 @@ describe Projects::BuildListsController, type: :controller do
|
|||
|
||||
context 'for user' do
|
||||
before do
|
||||
any_instance_of(BuildList, current_duration: 100)
|
||||
allow_any_instance_of(BuildList).to receive(:current_duration).and_return(100)
|
||||
@build_list = FactoryGirl.create(:build_list)
|
||||
@project = @build_list.project
|
||||
@owner_user = @project.owner
|
||||
|
|
|
@ -10,7 +10,8 @@ describe Projects::CommentsController, type: :controller do
|
|||
commit_id: @commit.id, format: :json }
|
||||
@update_params = { comment: { body: 'updated' }, name_with_owner: @project.name_with_owner, commit_id: @commit.id }
|
||||
|
||||
any_instance_of(Project, versions: ['v1.0', 'v2.0'])
|
||||
allow_any_instance_of(Project).to receive(:versions).and_return(%w(v1.0 v2.0))
|
||||
|
||||
@comment = FactoryGirl.create(:comment, commentable: @commit, project: @project)
|
||||
@user = FactoryGirl.create(:user)
|
||||
@own_comment = FactoryGirl.create(:comment, commentable: @commit, user: @user, project: @project)
|
||||
|
|
|
@ -56,7 +56,7 @@ describe Projects::SubscribesController, type: :controller do
|
|||
@create_params = { issue_id: @issue.serial_id, name_with_owner: @project.name_with_owner }
|
||||
@destroy_params = { issue_id: @issue.serial_id, name_with_owner: @project.name_with_owner }
|
||||
|
||||
any_instance_of(Project, versions: ['v1.0', 'v2.0'])
|
||||
allow_any_instance_of(Project).to receive(:versions).and_return(%w(v1.0 v2.0))
|
||||
|
||||
@request.env['HTTP_REFERER'] = project_issue_path(@project, @issue)
|
||||
end
|
||||
|
|
|
@ -9,7 +9,7 @@ describe UserMailer do
|
|||
@project = FactoryGirl.create(:project)
|
||||
@issue_user = FactoryGirl.create(:user)
|
||||
|
||||
any_instance_of(Project, versions: ['v1.0', 'v2.0'])
|
||||
allow_any_instance_of(Project).to receive(:versions).and_return(%w(v1.0 v2.0))
|
||||
|
||||
@issue = FactoryGirl.create(:issue, project: @project, assignee: @issue_user, user: @issue_user)
|
||||
@email = UserMailer.new_issue_notification(@issue, @issue_user).deliver!
|
||||
|
@ -44,7 +44,7 @@ describe UserMailer do
|
|||
@issue_user = FactoryGirl.create(:user)
|
||||
@user = FactoryGirl.create(:user)
|
||||
|
||||
any_instance_of(Project, versions: ['v1.0', 'v2.0'])
|
||||
allow_any_instance_of(Project).to receive(:versions).and_return(%w(v1.0 v2.0))
|
||||
|
||||
@issue = FactoryGirl.create(:issue, project_id: @project.id, assignee_id: @issue_user.id, user: @issue_user)
|
||||
@email = UserMailer.issue_assign_notification(@issue, @user).deliver!
|
||||
|
@ -76,7 +76,7 @@ describe UserMailer do
|
|||
@issue_user = FactoryGirl.create(:user)
|
||||
@user = FactoryGirl.create(:user)
|
||||
|
||||
any_instance_of(Project, versions: ['v1.0', 'v2.0'])
|
||||
allow_any_instance_of(Project).to receive(:versions).and_return(%w(v1.0 v2.0))
|
||||
|
||||
@issue = FactoryGirl.create(:issue, project: @project, assignee: @issue_user, user: @issue_user)
|
||||
@comment = FactoryGirl.create(:comment, commentable: @issue, user: @user, project: @project)
|
||||
|
|
|
@ -21,7 +21,7 @@ def set_comments_data_for_commit
|
|||
@subscribe_params = {project_id: @project.id, subscribeable_id: @commit.id.hex, subscribeable_type: @commit.class.name}
|
||||
Subscribe.destroy_all
|
||||
|
||||
any_instance_of(Project, versions: ['v1.0', 'v2.0'])
|
||||
allow_any_instance_of(Project).to receive(:versions).and_return(%w(v1.0 v2.0))
|
||||
end
|
||||
|
||||
def should_send_email(args={})
|
||||
|
|
|
@ -10,7 +10,7 @@ def set_commentable_data
|
|||
@comment = FactoryGirl.create(:comment, commentable: @issue, user: @user, project: @project)
|
||||
@stranger_comment = FactoryGirl.create(:comment, commentable: @issue, user: @stranger, project: @project)
|
||||
|
||||
any_instance_of(Project, versions: ['v1.0', 'v2.0'])
|
||||
allow_any_instance_of(Project).to receive(:versions).and_return(%w(v1.0 v2.0))
|
||||
end
|
||||
|
||||
def create_comment_in_issue issue, body
|
||||
|
|
|
@ -14,7 +14,7 @@ end
|
|||
describe Issue do
|
||||
before do
|
||||
stub_symlink_methods
|
||||
any_instance_of(Project, versions: ['v1.0', 'v2.0'])
|
||||
allow_any_instance_of(Project).to receive(:versions).and_return(%w(v1.0 v2.0))
|
||||
end
|
||||
|
||||
|
||||
|
|
|
@ -10,7 +10,7 @@ def set_data_for_pull
|
|||
|
||||
@other_project = FactoryGirl.create(:project_with_commit, owner: @user)
|
||||
|
||||
any_instance_of(Project, versions: ['v1.0', 'v2.0'])
|
||||
allow_any_instance_of(Project).to receive(:versions).and_return(%w(v1.0 v2.0))
|
||||
end
|
||||
|
||||
describe PullRequest do
|
||||
|
|
|
@ -7,7 +7,7 @@ def set_testable_data
|
|||
@project = FactoryGirl.create(:project)
|
||||
@issue = FactoryGirl.create(:issue, project_id: @project.id)
|
||||
|
||||
any_instance_of(Project, versions: ['v1.0', 'v2.0'])
|
||||
allow_any_instance_of(Project).to receive(:versions).and_return(%w(v1.0 v2.0))
|
||||
end
|
||||
|
||||
describe Subscribe do
|
||||
|
|
Loading…
Reference in New Issue