Merge pull request #1876 from consul/chore/rubocop_fixes

Manual 🤖  rubocop fixes
This commit is contained in:
BertoCQ
2017-09-19 11:22:18 +02:00
committed by GitHub
6 changed files with 10 additions and 10 deletions

View File

@@ -12,7 +12,7 @@ module CommunitiesHelper
community.from_proposal? ? t("community.show.description.proposal") : t("community.show.description.investment")
end
def is_author?(community, participant)
def author?(community, participant)
if community.from_proposal?
community.proposal.author_id == participant.id
else

View File

@@ -9,7 +9,7 @@ module DocumentablesHelper
end
def max_file_size(documentable)
bytesToMeg(documentable.class.max_file_size)
bytes_to_mega(documentable.class.max_file_size)
end
def accepted_content_types(documentable)
@@ -38,4 +38,4 @@ module DocumentablesHelper
documentable.documents.count >= documentable.class.max_documents_allowed
end
end
end

View File

@@ -8,7 +8,7 @@ module DocumentsHelper
document.errors[:attachment].join(', ') if document.errors.key?(:attachment)
end
def bytesToMeg(bytes)
def bytes_to_mega(bytes)
bytes / Numeric::MEGABYTE
end

View File

@@ -26,4 +26,4 @@ class Poll
end
end
end
end

View File

@@ -9,7 +9,7 @@
<%= link_to participant.name, user_path(participant)%>
</span>
<% if is_author?(@community, participant) %>
<% if author?(@community, participant) %>
&nbsp;&bull;&nbsp;
<span class="label round is-author">
<%= t("comments.comment.author") %>

View File

@@ -14,19 +14,19 @@ feature 'Admin shifts' do
booth1 = create(:poll_booth)
booth2 = create(:poll_booth)
shift1 = create(:poll_shift, officer: officer, booth: booth1, date: Date.today)
shift2 = create(:poll_shift, officer: officer, booth: booth2, date: Date.tomorrow)
shift1 = create(:poll_shift, officer: officer, booth: booth1, date: Time.zone.today)
shift2 = create(:poll_shift, officer: officer, booth: booth2, date: Time.zone.tomorrow)
visit new_admin_booth_shift_path(booth1)
expect(page).to have_css(".shift", count: 1)
expect(page).to have_content I18n.l(Date.today, format: :long)
expect(page).to have_content I18n.l(Time.zone.today, format: :long)
expect(page).to have_content officer.name
visit new_admin_booth_shift_path(booth2)
expect(page).to have_css(".shift", count: 1)
expect(page).to have_content I18n.l(Date.tomorrow, format: :long)
expect(page).to have_content I18n.l(Time.zone.tomorrow, format: :long)
expect(page).to have_content officer.name
end