fix pull requests controller specs

This commit is contained in:
Alexander Machehin 2014-08-29 15:54:15 +06:00
parent f3e6347fda
commit f5b343d350
1 changed files with 4 additions and 2 deletions

View File

@ -70,8 +70,10 @@ shared_examples_for 'pull request user with project reader rights' do
end
it "should not create already up-to-date pull" do
post :create, @create_params.merge({pull_request: {issue_attributes: {title: 'already', body: 'creating'}, to_ref: 'master', from_ref: 'master'}, to_project_id: @project.id})
PullRequest.joins(:issue).where(issues: {title: 'already', body: 'creating'}).count.should == 0
lambda{
post :create, @create_params.merge({pull_request: {issue_attributes: {title: 'already', body: 'creating'},
to_ref: 'master', from_ref: 'master'}, to_project_id: @project.id}) }.should
change{ PullRequest.count }.by(0)
end
it "should create pull request to the same project" do