Skip to content

Commit

Permalink
AO3-3997 Add missing error message in invitation page
Browse files Browse the repository at this point in the history
  • Loading branch information
potpotkettle committed Jul 6, 2023
1 parent 112ae8c commit 2de6037
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 1 deletion.
3 changes: 2 additions & 1 deletion app/views/invitations/_invitation.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,9 @@
<dd><%= invitation.invitee_email %></dd>
<% else %>
<dd>
<%= error_messages_for @invitation %>
<%= form_for(invitation) do |f| %>
<p><label for="invitee_email">Enter an email address:</label> <%= f.text_field :invitee_email %></p>
<p><%= label_tag "invitation[invitee_email]", t('.email_address_label') %>: <%= f.text_field :invitee_email %></p>
<p><%= hidden_field_tag :user_id, @user.try(:login) %></p>
<p class="submit actions"><%= f.submit %></p>
<% end %>
Expand Down
3 changes: 3 additions & 0 deletions config/locales/views/en.yml
Original file line number Diff line number Diff line change
Expand Up @@ -428,6 +428,9 @@ en:
home:
donate:
page_title: Donate or Volunteer
invitations:
invitation:
email_address_label: Enter an email address
invite_requests:
invite_request:
date: 'At our current rate, you should receive an invitation on or around: %{date}.'
Expand Down
12 changes: 12 additions & 0 deletions features/other_a/invite_request.feature
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,18 @@ Feature: Invite requests
And I should not see "Sorry, you have no unsent invitations right now."
And I should see "You have 2 open invitations and 0 that have been sent but not yet used."

Scenario: User can fail to send an invitation to an invalid email address

Given invitations are required
And I am logged in as "user1"
And I request some invites
And an admin grants the request
And I try to invite a friend from my user page
When all emails have been delivered
And I fill in "invitation[invitee_email]" with "test@"
And I press "Send Invitation"
Then I should see "Invitee email should look like an email address"

Scenario: User can send out invites they have been granted, and the recipient can sign up

Given invitations are required
Expand Down

0 comments on commit 2de6037

Please sign in to comment.