diff --git a/app/views/admins/index.html.erb b/app/views/admins/index.html.erb index fe97795f..499e7b96 100644 --- a/app/views/admins/index.html.erb +++ b/app/views/admins/index.html.erb @@ -76,13 +76,13 @@ <%= link_to "Approve", admin_approve_team_path(:team_id => t, :disc=> "#{s.disc3id}"), {:id=>"approve_3", :class=>'btn btn-xs btn-danger'} %> <%= label "disc_#{s.disc3id}", Discussion.find_by_id(s.disc3id).info %> - - <%= link_to "Send Email", admins_send_email_path(:team_id => t), {:id=>"sendemail_#{t.id}", :class=>'btn btn-xs btn-success'} %> - <% else %> Forming <% end %> + + <%= link_to "Send Email", admins_send_email_path(:team_id => t), {:id=>"sendemail_#{t.id}", :class=>'btn btn-xs btn-success'} %> + <% end %> diff --git a/features/admins/create_email.feature b/features/admins/create_email.feature index 4df02b39..316765a3 100644 --- a/features/admins/create_email.feature +++ b/features/admins/create_email.feature @@ -7,20 +7,21 @@ Feature: An admin sends an e-mail Background: Given the following users exist | name | email |team_passcode | major | sid | - | Sahai | eecs666@hotmail.com | penguindrool | EECS | 000 | + | Sahai | eecs666@hotmail.com | penguindrool | EECS | 000 | | Jorge | legueoflegends667@hotmail.com | penguindrool | Football Player | 999 | - | Kandi | justanotheremail@aol.com | anotherteam | EECS | 567 | + | Kandi | justanotheremail@aol.com | penguindrool | EECS | 567 | And the following admins exist | name | email | | Bob | supreme_ruler@aol.com | And the following discussions exist | number | time | capacity | | 54321 | Tues, 3pm | 25 | + And the team with passcode "penguindrool" is submitted And I am on the login page And I log in as an admin with email "supreme_ruler@aol.com" Scenario: Send E-mail button is available and redirects you to the send page - Given I follow "Send Email" + Given I first follow "Send Email" Then I should see "Send customized e-mail to team" Scenario: Fill In TextBox Area, and click Submit diff --git a/features/step_definitions/web_steps.rb b/features/step_definitions/web_steps.rb index 58449f54..91f40954 100644 --- a/features/step_definitions/web_steps.rb +++ b/features/step_definitions/web_steps.rb @@ -53,10 +53,14 @@ def with_scope(locator) click_button(button) end -When /^(?:|I )follow "([^"]*)"$/ do |link| +When /^(?:|I )first follow "([^"]*)"$/ do |link| click_link(link, match: :first) end +When /^(?:|I )follow "([^"]*)"$/ do |link| + click_link(link) +end + When /^(?:|I )fill in "([^"]*)" with "([^"]*)"$/ do |field, value| fill_in(field, :with => value) end