#168: fixed specs, refactoring of ActivityFeed
This commit is contained in:
parent
f055123d74
commit
4226af0a5d
|
@ -3,7 +3,7 @@
|
|||
.image= link_to(image_tag(avatar_url(user, :small), :alt => 'avatar'), user_path(user)) if user.persisted?
|
||||
.text
|
||||
%span
|
||||
= raw t('notifications.bodies.build_task', :task_num => task_num, :task_link => build_list_path(build_list_id))
|
||||
= raw t('notifications.bodies.build_task', :id => build_list_id, :task_link => build_list_path(build_list_id))
|
||||
= raw t('notifications.bodies.project', :project_link => link_to("#{project_owner}/#{project_name}", project_path(project_owner, project_name)) )
|
||||
- message, error = case status
|
||||
- when BuildList::BUILD_PENDING
|
||||
|
|
|
@ -39,7 +39,7 @@ en:
|
|||
delete_branch: '%{user_link} deleted a %{branch_name}'
|
||||
create_branch: '%{user_link} created a new branch %{branch_name}'
|
||||
update_branch: '%{user_link} pushed to branch %{branch_name}'
|
||||
build_task: 'Build <a href="%{task_link}">task #%{task_num}</a>'
|
||||
build_task: 'Build <a href="%{task_link}">task #%{id}</a>'
|
||||
build_status:
|
||||
published: published successfully
|
||||
success: completed successfully
|
||||
|
|
|
@ -40,7 +40,7 @@ ru:
|
|||
delete_branch: '%{user_link} удалил ветку %{branch_name}'
|
||||
create_branch: '%{user_link} создал новую ветку %{branch_name}'
|
||||
update_branch: '%{user_link} внес изменения в ветку %{branch_name}'
|
||||
build_task: 'Сборочное <a href="%{task_link}">задание №%{task_num}</a>'
|
||||
build_task: 'Сборочное <a href="%{task_link}">задание №%{id}</a>'
|
||||
build_status:
|
||||
published: успешно опубликовано
|
||||
success: успешно собрано
|
||||
|
|
|
@ -11,13 +11,13 @@ module Modules::Observers::ActivityFeed::BuildList
|
|||
def build_list_notifications
|
||||
if mass_build.blank? && ( # Do not show mass build activity in activity feeds
|
||||
status_changed? && [
|
||||
BuildList::BUILD_PENDING,
|
||||
BuildList::BUILD_PUBLISHED,
|
||||
BuildList::SUCCESS,
|
||||
BuildList::BUILD_ERROR,
|
||||
BuildList::FAILED_PUBLISH,
|
||||
BuildList::TESTS_FAILED
|
||||
].include?(status) ||
|
||||
status == BuildList::BUILD_PENDING
|
||||
].include?(status)
|
||||
)
|
||||
|
||||
updater = publisher || user
|
||||
|
@ -26,7 +26,6 @@ module Modules::Observers::ActivityFeed::BuildList
|
|||
:user => recipient,
|
||||
:kind => 'build_list_notification',
|
||||
:data => {
|
||||
:task_num => id,
|
||||
:build_list_id => id,
|
||||
:status => status,
|
||||
:updated_at => updated_at,
|
||||
|
|
|
@ -594,7 +594,7 @@ describe Api::V1::BuildListsController do
|
|||
@filter_build_list1 = FactoryGirl.create(:build_list)
|
||||
@filter_build_list2 = FactoryGirl.create(:build_list)
|
||||
@filter_build_list3 = FactoryGirl.create(:build_list)
|
||||
@filter_build_list4 = FactoryGirl.create(:build_list, :updated_at => (Time.now - 1,
|
||||
@filter_build_list4 = FactoryGirl.create(:build_list, :updated_at => (Time.now - 1.day),
|
||||
:project => @build_list3.project, :save_to_platform => @build_list3.save_to_platform,
|
||||
:arch => @build_list3.arch)
|
||||
end
|
||||
|
|
Loading…
Reference in New Issue