This commit is contained in:
Vokhmin Alexey V 2015-05-22 23:31:43 +03:00
parent 95d5f4a384
commit ae572b96d8
3 changed files with 33 additions and 37 deletions

View File

@ -37,7 +37,7 @@ module BuildListObserver
end
build_count = statistic.build_count.to_i
new_av_time = ( statistic.average_build_time * build_count + duration.to_i ) / ( build_count + 1 )
statistic.update_attributes({average_build_time: new_av_time, build_count: build_count + 1}, without_protection: true)
statistic.update_attributes(average_build_time: new_av_time, build_count: build_count + 1)
end
end
end

View File

@ -17,7 +17,6 @@ module Feed::Comment
if can_notify_on_new_comment?(subscribe)
UserMailer.new_comment_notification(self, subscribe.user_id).deliver unless own_comment?(subscribe.user)
ActivityFeed.create(
{
user_id: subscribe.user_id,
kind: 'new_comment_notification',
project_owner: project.owner_uname,
@ -32,7 +31,6 @@ module Feed::Comment
project_id: commentable.project.id,
comment_id: id
}
}, without_protection: true
)
end
end
@ -46,7 +44,6 @@ module Feed::Comment
UserMailer.new_comment_notification(self, subscribe.user_id).deliver
end
ActivityFeed.create(
{
user_id: subscribe.user_id,
kind: 'new_comment_commit_notification',
project_owner: project.owner_uname,
@ -62,7 +59,6 @@ module Feed::Comment
project_id: project.id,
comment_id: id
}
}, without_protection: true
)
end
end

View File

@ -191,8 +191,8 @@ describe BuildList do
auto_publish_status: BuildList::AUTO_PUBLISH_STATUS_DEFAULT,
project: project
)
bl.update_attributes({commit_hash: bl.project.repo.commits('master').last.id,
status: BuildList::BUILD_PUBLISH}, without_protection: true)
bl.update_attributes(commit_hash: bl.project.repo.commits('master').last.id,
status: BuildList::BUILD_PUBLISH)
bl.published
expect(subject.count).to eq 1
end
@ -287,7 +287,7 @@ describe BuildList do
let(:build_list) { FactoryGirl.create(:build_list) }
before do
build_list.update_attributes({ status: BuildList::SUCCESS }, without_protection: true)
build_list.update_attributes(status: BuildList::SUCCESS)
allow(build_list).to receive(:valid_branch_for_publish?).and_return(true)
end
@ -315,7 +315,7 @@ describe BuildList do
let(:build_list) { FactoryGirl.create(:build_list) }
before do
build_list.update_attributes({ status: BuildList::SUCCESS }, without_protection: true)
build_list.update_attributes(status: BuildList::SUCCESS)
end
it 'returns true for eligible build' do