Merge pull request #1876 from consul/chore/rubocop_fixes
Manual 🤖 rubocop fixes
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
|
||||
@@ -26,4 +26,4 @@ class Poll
|
||||
end
|
||||
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
@@ -9,7 +9,7 @@
|
||||
<%= link_to participant.name, user_path(participant)%>
|
||||
</span>
|
||||
|
||||
<% if is_author?(@community, participant) %>
|
||||
<% if author?(@community, participant) %>
|
||||
•
|
||||
<span class="label round is-author">
|
||||
<%= t("comments.comment.author") %>
|
||||
|
||||
@@ -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
|
||||
|
||||
|
||||
Reference in New Issue
Block a user