fixed wrong indenting and broken messages tab for polls

This commit is contained in:
Jannik Streek 2014-03-21 19:09:24 +01:00
parent 8a4f833d1d
commit c02414c36d
5 changed files with 14 additions and 16 deletions

View file

@ -59,7 +59,6 @@
resize: none;
height: 50px;
}
}
&.active textarea {
min-height: 70px;
@ -79,7 +78,6 @@
line-height: 20px !important;
width: 100% !important;
}
}
&.with_attachments .row-fluid#photodropzone_container {
border-top: 1px dashed $border-grey;

View file

@ -15,7 +15,7 @@ class Poll < ActiveRecord::Base
validate :enough_poll_answers
def enough_poll_answers
errors.add(:poll_answers, I18n.t("activerecord.errors.models.poll.attributes.poll_answers.not_enough_poll_answers")) if poll_answers.size < 2
errors.add(:poll_answers, I18n.t("activerecord.errors.models.poll.attributes.poll_answers.not_enough_poll_answers")) if poll_answers.size < 2
end
end

View file

@ -9,8 +9,8 @@ class PollAnswer < ActiveRecord::Base
xml_attr :answer
def update_vote_counter
self.vote_count = self.vote_count + 1
self.save!
self.vote_count = self.vote_count + 1
self.save!
end
end

View file

@ -52,7 +52,7 @@ class PollParticipation < ActiveRecord::Base
existing = PollParticipation.where(author_id: self.author.id, poll_id: self.poll.id)
if existing.first != self and existing.count != 0
self.errors.add(:poll, I18n.t("errors.models.poll_participations.attributes.poll.already_participated"))
self.errors.add(:poll, I18n.t("activerecord.errors.models.poll_participations.attributes.poll.already_participated"))
end
end

View file

@ -29,7 +29,7 @@ describe PollParticipation do
end
describe 'xml' do
describe 'xml' do
before do
@poll_participant = FactoryGirl.create(:user)
@poll_participant_aspect = @poll_participant.aspects.create(:name => "bruisers")
@ -75,22 +75,22 @@ describe PollParticipation do
end
describe 'it is relayable' do
before do
@local_luke, @local_leia, @remote_raphael = set_up_friends
@remote_parent = FactoryGirl.build(:status_message_with_poll, :author => @remote_raphael)
before do
@local_luke, @local_leia, @remote_raphael = set_up_friends
@remote_parent = FactoryGirl.build(:status_message_with_poll, :author => @remote_raphael)
@local_parent = @local_luke.post :status_message, :text => "hi", :to => @local_luke.aspects.first
@local_parent = @local_luke.post :status_message, :text => "hi", :to => @local_luke.aspects.first
@poll2 = Poll.new(:question => 'Who is now in charge?')
@poll2.poll_answers.build(:answer => "a")
@poll2.poll_answers.build(:answer => "b")
@local_parent.poll = @poll2
@object_by_parent_author = @local_luke.participate_in_poll!(@local_parent, @poll2.poll_answers.first)
@object_by_recipient = @local_leia.participate_in_poll!(@local_parent, @poll2.poll_answers.first)
@dup_object_by_parent_author = @object_by_parent_author.dup
@object_by_parent_author = @local_luke.participate_in_poll!(@local_parent, @poll2.poll_answers.first)
@object_by_recipient = @local_leia.participate_in_poll!(@local_parent, @poll2.poll_answers.first)
@dup_object_by_parent_author = @object_by_parent_author.dup
@object_on_remote_parent = @local_luke.participate_in_poll!(@remote_parent, @remote_parent.poll.poll_answers.first)
end
@object_on_remote_parent = @local_luke.participate_in_poll!(@remote_parent, @remote_parent.poll.poll_answers.first)
end
let(:build_object) { PollParticipation::Generator.new(alice, @status, @poll.poll_answers.first).build }
it_should_behave_like 'it is relayable'