Skip to content

Instantly share code, notes, and snippets.

@webgago
Created August 16, 2012 11:23
Show Gist options
  • Save webgago/3369433 to your computer and use it in GitHub Desktop.
Save webgago/3369433 to your computer and use it in GitHub Desktop.
Views & Decorators
- if @act_record_deaths.empty?
%h2 Ничего не найдено
- else
%table.statements-table.table.table-striped.table-bordered.table-condensed
%thead
%tr
%th= "Дата записи акта"
%th= "Номер записи акта"
%th= "ФИО Заявителя"
%th= "ФИО Умершего"
%th= ""
%tbody
= content_tag_for(:tr, @act_record_deaths,
{onmouseover: "$(this).addClass('hovered')", onmouseout: "$(this).removeClass('hovered')", onclick: "location.href=$(this).find('a').attr('href')"}) do |act|
%td= l act.registration_date, format: :long
%td.td-service= link_to act.document_number, [act.statement, act]
%td= act.applicant.fio
%td= act.dead.fio
%td
%span.status-text
- if act.ezags_uid
%i.status-icon.ready
- else
%i.status-icon.cancel
class Decorator < BaseDecoratorClass
def header
first_part_of_header << second_part_of_header
end
end
= render "buttons"
= render "shared/left_menu_of_death"
= div_for resource do
#up.statement-block
%h2= decorator.header
= render "shared/death/dead"
= render "shared/death/applicant"
= render "confirming_death"
= render "certificate"
= render "shared/other_information"
= render 'shared/certificate_modal'
# stub partials
it "foo bar partial" do
stub_template "shared/birth/_mother" => "MOTHER"
rendered.should have_content "MOTHER"
end
it "foo bar header decorator spec" do
rendered.should have_content decorator.first_part_of_header
rendered.should have_content decorator.second_part_of_header
end
# stub partials
it "foo bar partial" do
stub_template "shared/birth/_mother" => "MOTHER"
rendered.should have_content "MOTHER"
end
it "foo bar header decorator spec" do
decorator.stub(first_part_of_header: 'decorator.first_part_of_header',
second_part_of_header: 'decorator.second_part_of_header')
rendered.should have_content decorator.first_part_of_header
rendered.should have_content decorator.second_part_of_header
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment