Skip to content

Commit

Permalink
Rename clashing method name full_url_for to email_full_url_for
Browse files Browse the repository at this point in the history
  • Loading branch information
CodeHex committed Sep 15, 2023
1 parent daa7230 commit 13a86b4
Show file tree
Hide file tree
Showing 23 changed files with 36 additions and 26 deletions.
2 changes: 1 addition & 1 deletion app/helpers/email_helper.rb
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
module EmailHelper
private

def full_url_for(path)
def email_full_url_for(path)
"#{@host}#{path}"
end
end
2 changes: 1 addition & 1 deletion app/mailers/event_invitation_mailer.rb
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ def attending(event, member, invitation)
private

helper do
def full_url_for(path)
def email_full_url_for(path)
"#{@host}#{path}"
end
end
Expand Down
2 changes: 1 addition & 1 deletion app/mailers/feedback_request_mailer.rb
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ def request_feedback(workshops, member, feedback_request)
end

helper do
def full_url_for(path)
def email_full_url_for(path)
"#{@host}#{path}"
end
end
Expand Down
2 changes: 1 addition & 1 deletion app/mailers/meeting_invitation_mailer.rb
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ def attendance_reminder(meeting, member)
private

helper do
def full_url_for(path)
def email_full_url_for(path)
"#{@host}#{path}"
end
end
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@ Hi #{@contact.name},
%p
You have been subscribed to codebar's sponsors mailing list. To opt-out follow the link below:
%br
=link_to 'Update subscription preferences', full_url_for(contact_preferences_url(token: @contact.token)), class: 'btn'
=link_to 'Update subscription preferences', email_full_url_for(contact_preferences_url(token: @contact.token)), class: 'btn'
2 changes: 1 addition & 1 deletion app/views/event_invitation_mailer/attending.html.haml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
%h4
#{@event.name}
%small #{humanize_date(@event.date_and_time, @event.ends_at, with_time: true)}
= link_to 'Update your attendance', full_url_for(event_invitation_url(@event.id, @invitation.token)), class: 'btn'
= link_to 'Update your attendance', email_full_url_for(event_invitation_url(@event.id, @invitation.token)), class: 'btn'

.content
%table
Expand Down
2 changes: 1 addition & 1 deletion app/views/event_invitation_mailer/invite_coach.html.haml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
%h4
#{@event.name}
%small #{humanize_date(@event.date_and_time, @event.ends_at, with_time: true)}
= link_to 'View invitation and RSVP', full_url_for(event_invitation_url(event_id: @event.slug, token: @invitation.token)), class: 'btn'
= link_to 'View invitation and RSVP', email_full_url_for(event_invitation_url(event_id: @event.slug, token: @invitation.token)), class: 'btn'

- if @event.venue.present?
.content
Expand Down
2 changes: 1 addition & 1 deletion app/views/event_invitation_mailer/invite_student.html.haml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
%h4
#{@event.name}
%small #{humanize_date(@event.date_and_time, @event.ends_at, with_time: true)}
= link_to 'View invitation and RSVP', full_url_for(event_invitation_url(event_id: @event.slug, token: @invitation.token)), class: 'btn'
= link_to 'View invitation and RSVP', email_full_url_for(event_invitation_url(event_id: @event.slug, token: @invitation.token)), class: 'btn'

- if @event.venue.present?
.content
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
%tr
%td
%p
=link_to "Submit feedback", full_url_for(feedback_url(@feedback_request.token)), class: 'btn'
=link_to "Submit feedback", email_full_url_for(feedback_url(@feedback_request.token)), class: 'btn'

.content
= render partial: 'shared_mailers/social', locals: { workshop: @workshop }
Expand Down
2 changes: 1 addition & 1 deletion app/views/layouts/email.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
<div style="color: #111111; font-size: 15px; font-weight: 300; margin-top: 60px;">Despo</div>
<div style="color: #111111; font-size: 16px; font-weight: 600; margin-top: 5px;"><a href="http://codebar.io" style="color: #663095; text-decoration: none;">codebar</a></div>

<p style="color: #6d6a6a; font-size: 13px; font-weight: 600; margin-top: 90px;">If you dont want to receive these emails <%= link_to "unsubscribe", full_url_for(unsubscribe_url(member_token(@member))), style: "color: #a369d5; text-decoration: underline" %></p>
<p style="color: #6d6a6a; font-size: 13px; font-weight: 600; margin-top: 90px;">If you dont want to receive these emails <%= link_to "unsubscribe", email_full_url_for(unsubscribe_url(member_token(@member))), style: "color: #a369d5; text-decoration: underline" %></p>
</div>

<div style="width: 100%; height: 40px; background-color: #f6f4f8;"></div>
Expand Down
2 changes: 1 addition & 1 deletion app/views/shared_mailers/_footer.html.haml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,6 @@
%tr
%td{ align: "center" }
%p
%a{ href: full_url_for(unsubscribe_url(member_token(@member))) }
%a{ href: email_full_url_for(unsubscribe_url(member_token(@member))) }
%unsubscribe Unsubscribe
%td
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
%td
%h4
%small #{humanize_date(@workshop.date_and_time, @workshop.ends_at, with_time: true)}
= link_to 'Update or cancel your attendance', full_url_for(invitation_url(@invitation)), class: 'btn'
= link_to 'Update or cancel your attendance', email_full_url_for(invitation_url(@invitation)), class: 'btn'

.content
%table
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
%td
%h4
%small #{humanize_date(@workshop.date_and_time, @workshop.ends_at, with_time: true)}
= link_to 'Update or cancel your attendance', full_url_for(invitation_url(@invitation)), class: 'btn'
= link_to 'Update or cancel your attendance', email_full_url_for(invitation_url(@invitation)), class: 'btn'

.content
%table
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
%br
%br
%small #{humanize_date(@workshop.date_and_time, @workshop.ends_at, with_time: true)}
= link_to 'View invitation and RSVP', full_url_for(invitation_url(@invitation)), class: 'btn'
= link_to 'View invitation and RSVP', email_full_url_for(invitation_url(@invitation)), class: 'btn'
%td{ width: '40%', style: 'vertical-align: top;'}
- if @workshop.sponsors.any?
%h4 Sponsored by
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
%p.lead
We’d love to have you at our next #{@workshop.chapter.name} virtual workshop.
%p
As part of our workshops, you’ll get to work through any of our #{link_to 'tutorials', 'http://codebar.github.io/tutorials' } or receive guidance on your personal project. We believe that everyone should be entitled to free learning and our community has #{ link_to 'a lot of devoted developers', full_url_for(coaches_url)} who help out as coaches.
As part of our workshops, you’ll get to work through any of our #{link_to 'tutorials', 'http://codebar.github.io/tutorials' } or receive guidance on your personal project. We believe that everyone should be entitled to free learning and our community has #{ link_to 'a lot of devoted developers', email_full_url_for(coaches_url)} who help out as coaches.
%p You will also get the opportunity to interact with other people interested in coding and collaborate with them.
%p Please note: We do not accept any RSVPs over email.

Expand All @@ -27,7 +27,7 @@
%td{ width: '60%', style: 'vertical-align: top; padding-right: 20px;' }
%h4
%small #{humanize_date(@workshop.date_and_time, @workshop.ends_at, with_time: true)}
= link_to 'View invitation and RSVP', full_url_for(invitation_url(@invitation)), class: 'btn'
= link_to 'View invitation and RSVP', email_full_url_for(invitation_url(@invitation)), class: 'btn'
%td{ width: '40%', style: 'vertical-align: top;'}
- if @workshop.sponsors.any?
%h4 Sponsored by
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
so you should keep the slot available and check your email during the afternoon on the day of the workshop.
%p
Alternatively, if you know you can no longer make it, please
= link_to 'remove yourself from the waiting list', full_url_for(invitation_url(@invitation))
= link_to 'remove yourself from the waiting list', email_full_url_for(invitation_url(@invitation))
so someone else can take part in the workshop.

.content
Expand All @@ -30,7 +30,7 @@
%td
%h4
%small #{humanize_date(@workshop.date_and_time, @workshop.ends_at, with_time: true)}
= link_to 'Update or cancel your attendance', full_url_for(invitation_url(@invitation)), class: 'btn'
= link_to 'Update or cancel your attendance', email_full_url_for(invitation_url(@invitation)), class: 'btn'

.content
%table
Expand Down
2 changes: 1 addition & 1 deletion app/views/workshop_invitation_mailer/attending.html.haml
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@
%h4
Workshop
%small #{humanize_date(@workshop.date_and_time, @workshop.ends_at, with_time: true)}
= link_to 'Update your attendance', full_url_for(invitation_url(@invitation)), class: 'btn'
= link_to 'Update your attendance', email_full_url_for(invitation_url(@invitation)), class: 'btn'

.content
%table
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
%h4
Workshop
%small #{humanize_date(@workshop.date_and_time, @workshop.ends_at, with_time: true)}
= link_to 'Update your attendance', full_url_for(invitation_url(@invitation)), class: 'btn'
= link_to 'Update your attendance', email_full_url_for(invitation_url(@invitation)), class: 'btn'

.content
%table
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@
Workshop
%br
%small #{humanize_date(@workshop.date_and_time, @workshop.ends_at, with_time: true)}
= link_to 'View invitation and RSVP', full_url_for(invitation_url(@invitation)), class: 'btn'
= link_to 'View invitation and RSVP', email_full_url_for(invitation_url(@invitation)), class: 'btn'
%td{ width: '40%', style: 'vertical-align: top;'}
%h4
Venue
Expand Down
4 changes: 2 additions & 2 deletions app/views/workshop_invitation_mailer/invite_student.html.haml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
%p.lead
We’d love to have you at our next #{@workshop.chapter.name} workshop. RSVP now to secure a spot, some light bites and time with a dedicated coach.
%p
As part of our workshop, you'll get to work through any of our #{link_to 'tutorials', 'http://codebar.github.io/tutorials' } or receive guidance on your personal project. We believe that everyone should be entitled to free learning and our community has #{ link_to 'a lot of devoted developers', full_url_for(coaches_url)} who help out as coaches.
As part of our workshop, you'll get to work through any of our #{link_to 'tutorials', 'http://codebar.github.io/tutorials' } or receive guidance on your personal project. We believe that everyone should be entitled to free learning and our community has #{ link_to 'a lot of devoted developers', email_full_url_for(coaches_url)} who help out as coaches.
%p You will also get the opportunity to meet other people interested in coding and collaborate with them.
%p We’re looking forward to having you with us. See you there!
%p Please note: We do not accept any RSVPs over email.
Expand All @@ -30,7 +30,7 @@
Workshop
%br
%small #{humanize_date(@workshop.date_and_time, @workshop.ends_at, with_time: true)}
= link_to 'View invitation and RSVP', full_url_for(invitation_url(@invitation)), class: 'btn'
= link_to 'View invitation and RSVP', email_full_url_for(invitation_url(@invitation)), class: 'btn'
%td{ width: '40%', style: 'vertical-align: top;'}
%h4
Venue
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
%h4
Workshop
%small #{humanize_date(@workshop.date_and_time, @workshop.ends_at, with_time: true)}
= link_to 'Update your attendance', full_url_for(invitation_url(@invitation)), class: 'btn'
= link_to 'Update your attendance', email_full_url_for(invitation_url(@invitation)), class: 'btn'

.content
%table
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
so you should keep your laptop with you and check your email during the afternoon on the day of the workshop.
%p
Alternatively, if you know you can no longer make it, you should
= link_to 'remove yourself from the waiting list', full_url_for(invitation_url(@invitation))
= link_to 'remove yourself from the waiting list', email_full_url_for(invitation_url(@invitation))
so someone else can come to the workshop.

.content
Expand All @@ -32,7 +32,7 @@
Workshop
%br
%small #{humanize_date(@workshop.date_and_time, @workshop.ends_at, with_time: true)}
= link_to 'Update your attendance', full_url_for(invitation_url(@invitation)), class: 'btn'
= link_to 'Update your attendance', email_full_url_for(invitation_url(@invitation)), class: 'btn'
%td{ width: '40%', style: 'vertical-align: top;'}
%h4
Venue
Expand Down
10 changes: 10 additions & 0 deletions spec/features/admin/feedback_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,16 @@
visit admin_feedback_index_path
feedbacks.each { |feedback| expect(page).to have_content(feedback.request) }
end

it 'has access to the second page of feedback' do
feedbacks = Fabricate.times(50, :feedback)

visit admin_feedback_index_path

# Check if the page has a link with the text '2' that leads to the second page of feedback
second_page_path = Rails.application.routes.url_for(controller: 'admin/feedback', action: 'index', only_path: true, page: 2)
expect(page).to have_link('2', href: second_page_path)
end
end

context 'an organiser' do
Expand Down

0 comments on commit 13a86b4

Please sign in to comment.