Skip to content

Commit

Permalink
Merge branch 'release/0.14.2.3'
Browse files Browse the repository at this point in the history
  • Loading branch information
kalashnikovisme committed Jan 29, 2017
2 parents 9d16ce0 + 67bd8ba commit e84bdae
Show file tree
Hide file tree
Showing 32 changed files with 311 additions and 1 deletion.
4 changes: 4 additions & 0 deletions app/decorators/activity_lines/corporative/merit_decorator.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,10 @@ class ActivityLines::Corporative::MeritDecorator < ApplicationDecorator

decorates_association :user

def name
"Почётный знак за заслуги перед МИЦ #{object.nomination} #{object.user.decorate.short_name}"
end

def self.collections
[ :honorary_members, :second_degree ]
end
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,10 @@ class ActivityLines::Lider::YaLider::ParticipantDecorator < ApplicationDecorator

decorates_association :user

def name
object.user.decorate.short_name
end

def self.collections
[:active, :won, :lost, :declined]
end
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
class ActivityLines::Lider::YaLider::ParticipantFieldDecorator < ApplicationDecorator
delegate_all

def name
"#{object.participant.user.decorate.short_name} #{object.title}"
end
end
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,10 @@ class ActivityLines::Lider::YaLider::StageDecorator < ApplicationDecorator

decorates_association :participants

def name
full_title
end

def full_title
"#{object.number} этап #{to_text_in_roman(object.contest.contest_number)} областного конкурса актива учащейся молодёжи «Я-лидер!» #{object.title}"
end
Expand Down
6 changes: 6 additions & 0 deletions app/decorators/feedback_decorator.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,12 @@ class FeedbackDecorator < ApplicationDecorator

decorates_association :user

def name
if object.user
"Обратная связь от #{object.user.decorate.short_name}"
end
end

def date
I18n.l object.created_at, format: '%d %b'
end
Expand Down
1 change: 1 addition & 0 deletions app/views/web/admin/events/shared/_place_form.html.haml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
= simple_form_for @place, remote: true, url: { controller: 'api/admin/places', action: :create } do |f|
= f.input :title, as: :string, required: true
= f.input :description, as: :string, required: true
= hint @place.model.class.to_s, :url, place: :admin
= f.input :url, as: :string, required: true
= link_to fa_icon(:foursquare), "https://foursquare.com", class: 'btn btn-info blank'
= link_to fa_icon(:google), "https://maps.google.com", class: 'btn btn-info blank'
Expand Down
2 changes: 2 additions & 0 deletions config/locales/ru/admin.yml
Original file line number Diff line number Diff line change
Expand Up @@ -119,5 +119,7 @@ ru:
mailing_date: 'Если вы не хотите делать отложенную рассылку, оставьте пустым'
activity_lines/lider/ya_lider/participant:
user_id: Выберите из списка зарегистрированных пользователей. Если пользователь не найден, создайте нового
place:
url: Найдите место в одном из предложенных ниже сервисов. После нахождения вашего места, скопируйте содержимое адресной строки в поле URL
notices:
functional_in_beta: Функционал находится на бета-тестировании. Это означает, что всё использование этого функционала надо согласовывать с разработчиками сайта. Обязательность согласования пропадёт после прохождения функционалом бета-тестирования.
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,18 @@ class Web::Admin::ActivityLines::Corporative::ConfessionsControllerTest < Action
assert_response :success, @response.body
end

test 'should get index all pages and tabs' do
if ENV['DB'] == 'prod'
ActivityLines::Corporative::ConfessionDecorator.collections.each do |collection|
pages = ActivityLines::Corporative::Confession.send(collection).count / 25
(pages + 2).times do |page|
get :index, page: page
assert_response :success
end
end
end
end

test 'should get show' do
4.times { create :argument }
get :show, id: @confession
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,18 @@ class Web::Admin::ActivityLines::Corporative::MeritsControllerTest < ActionContr
assert_response :success, @response.body
end

test 'should get index all pages and tabs' do
if ENV['DB'] == 'prod'
ActivityLines::Corporative::MeritDecorator.collections.each do |collection|
pages = ActivityLines::Corporative::Merit.send(collection).count / 25
(pages + 2).times do |page|
get :index, page: page
assert_response :success
end
end
end
end

test 'should get index with search' do
get :index, search: @merit.year
assert_response :success, @response.body
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,17 @@ class Web::Admin::ActivityLines::Corporative::OnlineConferencesControllerTest <
assert_response :success, @response.body
end

test 'should get index all pages and tabs' do
if ENV['DB'] == 'prod'
ActivityLines::Corporative::OnlineConferenceDecorator.collections.each do |collection|
pages = ActivityLines::Corporative::OnlineConference.send(collection).count / 25
(pages + 2).times do |page|
get :index, page: page
assert_response :success
end
end
end
end
test 'should get index without instances' do
::ActivityLines::Corporative::OnlineConference.destroy_all
get :index
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,18 @@ class Web::Admin::ActivityLines::Lider::YaLider::ParticipantsControllerTest < Ac
assert_response :success
end

test 'should get index all pages and tabs' do
if ENV['DB'] == 'prod'
ActivityLines::Lider::YaLider::ParticipantDecorator.collections.each do |collection|
pages = ActivityLines::Lider::YaLider::Participant.send(collection).count / 25
(pages + 2).times do |page|
get :index, page: page
assert_response :success
end
end
end
end

test 'should get index with contest_id' do
get :index, contest_id: @participant.contest_id
assert_response :success
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,18 @@ class Web::Admin::ActivityLines::Lider::YaLidersControllerTest < ActionControlle
assert_response :success, @response.body
end

test 'should get index all pages and tabs' do
if ENV['DB'] == 'prod'
ActivityLines::Lider::YaLiderDecorator.collections.each do |collection|
pages = ActivityLines::Lider::YaLider.send(collection).count / 25
(pages + 2).times do |page|
get :index, page: page
assert_response :success
end
end
end
end

test 'should get index with search' do
get :index, search: @ya_lider.contest_year
assert_response :success, @response.body
Expand Down
12 changes: 12 additions & 0 deletions test/controllers/web/admin/activity_lines_controller_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,18 @@ class Web::Admin::ActivityLinesControllerTest < ActionController::TestCase
assert_response :success, @response.body
end

test 'should get index all pages and tabs' do
if ENV['DB'] == 'prod'
ActivityLineDecorator.collections.each do |collection|
pages = ActivityLine.send(collection).count / 25
(pages + 2).times do |page|
get :index, page: page
assert_response :success
end
end
end
end

test 'should get index with search' do
get :index, search: @activity_line.title
assert_response :success, @response.body
Expand Down
12 changes: 12 additions & 0 deletions test/controllers/web/admin/articles_controller_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,18 @@ class Web::Admin::ArticlesControllerTest < ActionController::TestCase
assert_response :success, @response.body
end

test 'should get index all pages and tabs' do
if ENV['DB'] == 'prod'
ArticleDecorator.collections.each do |collection|
pages = Article.send(collection).count / 25
(pages + 2).times do |page|
get :index, page: page
assert_response :success
end
end
end
end

test 'should get index without instances' do
Article.destroy_all
get :index
Expand Down
12 changes: 12 additions & 0 deletions test/controllers/web/admin/banners_controller_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,18 @@ class Web::Admin::BannersControllerTest < ActionController::TestCase
assert_response :success, @response.body
end

test 'should get index all pages and tabs' do
if ENV['DB'] == 'prod'
BannerDecorator.collections.each do |collection|
pages = Banner.send(collection).count / 25
(pages + 2).times do |page|
get :index, page: page
assert_response :success
end
end
end
end

test 'should get index with search' do
get :index, search: @banner.link
assert_response :success, @response.body
Expand Down
12 changes: 12 additions & 0 deletions test/controllers/web/admin/comments_controller_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,18 @@ class Web::Admin::CommentsControllerTest < ActionController::TestCase
assert_response :success, @response.body
end

test 'should get index all pages and tabs' do
if ENV['DB'] == 'prod'
CommentDecorator.collections.each do |collection|
pages = Comment.send(collection).count / 25
(pages + 2).times do |page|
get :index, page: page
assert_response :success
end
end
end
end

test 'should get index without instances' do
Comment.destroy_all
get :index
Expand Down
12 changes: 12 additions & 0 deletions test/controllers/web/admin/delivery/campaigns_controller_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,18 @@ class Web::Admin::Delivery::CampaignsControllerTest < ActionController::TestCase
assert_response :success, @response.body
end

test 'should get index all pages and tabs' do
if ENV['DB'] == 'prod'
Delivery::CampaignDecorator.collections.each do |collection|
pages = Delivery::Campaign.send(collection).count / 25
(pages + 2).times do |page|
get :index, page: page
assert_response :success
end
end
end
end

test 'should get index with search' do
create_list :delivery_campaign, 5
get :index, search: @campaign.link
Expand Down
10 changes: 10 additions & 0 deletions test/controllers/web/admin/documents_controller_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,16 @@ class Web::Admin::DocumentsControllerTest < ActionController::TestCase
assert_response :success, @response.body
end

test 'should get index all pages and tabs' do
if ENV['DB'] == 'prod'
pages = Document.count / 25
(pages + 2).times do |page|
get :index, page: page
assert_response :success
end
end
end

test 'should get index without instances' do
Document.destroy_all
get :index
Expand Down
12 changes: 12 additions & 0 deletions test/controllers/web/admin/events_controller_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,18 @@ class Web::Admin::EventsControllerTest < ActionController::TestCase
assert_response :success, @response.body
end

test 'should get index all pages and tabs' do
if ENV['DB'] == 'prod'
EventDecorator.collections.each do |collection|
pages = Event.send(collection).count / 25
(pages + 2).times do |page|
get :index, page: page
assert_response :success
end
end
end
end

test 'should get index without instances' do
Event.destroy_all
get :index
Expand Down
12 changes: 12 additions & 0 deletions test/controllers/web/admin/feedbacks_controller_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,18 @@ class Web::Admin::FeedbacksControllerTest < ActionController::TestCase
assert_response :success, @response.body
end

test 'should get index all pages and tabs' do
if ENV['DB'] == 'prod'
FeedbackDecorator.collections.each do |collection|
pages = Feedback.send(collection).count / 25
(pages + 2).times do |page|
get :index, page: page
assert_response :success
end
end
end
end

test 'should get index without instances' do
Feedback.destroy_all
get :index
Expand Down
12 changes: 12 additions & 0 deletions test/controllers/web/admin/images_controller_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,18 @@ class Web::Admin::ImagesControllerTest < ActionController::TestCase
assert_response :success, @response.body
end

test 'should get index all pages and tabs' do
if ENV['DB'] == 'prod'
ImageDecorator.collections.each do |collection|
pages = Image.send(collection).count / 25
(pages + 2).times do |page|
get :index, page: page
assert_response :success
end
end
end
end

test 'should get index with search' do
get :index, search: @image.author_name
assert_response :success, @response.body
Expand Down
12 changes: 12 additions & 0 deletions test/controllers/web/admin/letters_controller_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,18 @@ class Web::Admin::LettersControllerTest < ActionController::TestCase
assert_response :success, @response.body
end

test 'should get index all pages and tabs' do
if ENV['DB'] == 'prod'
LetterDecorator.collections.each do |collection|
pages = Letter.send(collection).count / 25
(pages + 2).times do |page|
get :index, page: page
assert_response :success
end
end
end
end

test 'should get index without instances' do
Letter.all.map &:destroy
get :index
Expand Down
10 changes: 10 additions & 0 deletions test/controllers/web/admin/logged_actions_controller_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,16 @@ class Web::Admin::LoggedActionsControllerTest < ActionController::TestCase
assert_response :success, @response.body
end

test 'should get index all pages and tabs' do
if ENV['DB'] == 'prod'
pages = LoggedAction.count / 25
(pages + 2).times do |page|
get :index, page: page
assert_response :success
end
end
end

test 'should get index without instances' do
LoggedAction.all.map &:destroy
get :index
Expand Down
12 changes: 12 additions & 0 deletions test/controllers/web/admin/members_controller_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,18 @@ class Web::Admin::MembersControllerTest < ActionController::TestCase
assert_response :success, @response.body
end

test 'should get index all pages and tabs' do
if ENV['DB'] == 'prod'
MemberDecorator.collections.each do |collection|
pages = Member.send(collection).count / 25
(pages + 2).times do |page|
get :index, page: page
assert_response :success
end
end
end
end

test 'should get show' do
get :show, id: @member
assert_response :success, @response.body
Expand Down
Loading

0 comments on commit e84bdae

Please sign in to comment.