Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Refactor Teams to Team Listing #36

Merged
merged 2 commits into from
Dec 4, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion app/controllers/team_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ def do_email
end
@user.email_team(@team.id)
@user.save!
redirect_to teams_path, notice: 'Email sent successfully.'
redirect_to team_list_path, notice: 'Email sent successfully.'
end

def show
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Controller for teams. Consist fo all teams.
class TeamsController < ApplicationController
class TeamListController < ApplicationController
def show
@teams = Team.all
end
Expand Down
2 changes: 1 addition & 1 deletion app/views/shared/_head.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
<li><%= link_to "Log In", "/auth/google_oauth2", id: "log_in_header" %></li>
<% else %>
<% if session[:is_admin].nil? %>
<li><%= link_to "Teams", '/teams' %></li>
<li><%= link_to "Teams", '/team_list' %></li>
<li><%= link_to "Help", help_path %></li>
<li><%= link_to "My Info", user_path(session[:user_id]), {method: 'get'} %></li>
<% else %>
Expand Down
File renamed without changes.
2 changes: 1 addition & 1 deletion config/routes.rb
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
post '/join_team', to: 'users#join_team'
get '/help', to: 'users#user_help'

get '/teams', to: 'teams#show', as: 'teams'
get '/team_list', to: 'team_list#show', as: 'team_list'
get '/team/:id/email', to: 'team#email', as: 'email_team'
post '/team/:id/email', to: 'team#do_email', as: 'do_email_team'

Expand Down
2 changes: 1 addition & 1 deletion features/step_definitions/enrollme_steps.rb
Original file line number Diff line number Diff line change
Expand Up @@ -202,7 +202,7 @@
team_id = curr_user.team.id
step %Q{I follow "Logout"}
step %Q{I log in as a user with email "#{user.email}"}
step %Q{I am on the teams page}
step %Q{I am on the team list page}
step %Q{I contact "Team #{team_id}" with the message "hello"}
step %Q{I follow "Logout"}
step %Q{I log in as a user with email "#{curr_user.email}"}
Expand Down
12 changes: 6 additions & 6 deletions features/users/name_on_teams_page.feature
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
Feature: Optional Display Username on Teams Page
Feature: Optional Display Username on Team List Page
As a user
So that I can control my anonymity
I want to be able to choose whether my name is displayed on the teams page.
I want to be able to choose whether my name is displayed on the team list page.

Background:
Given the following users exist
Expand All @@ -13,17 +13,17 @@ Feature: Optional Display Username on Teams Page
And I log in as a user with email "eecs666@hotmail.com"
And I follow "My Info"

Scenario: I want to display my name on the teams page
Scenario: I want to display my name on the team list page
Given I follow "Edit"
And I check "Name Visible to Other Teams"
And I press "Update Information"
And I am on the teams page
And I am on the team list page
Then I should see "Sahai"

Scenario: I do not want to display my name on the teams page
Scenario: I do not want to display my name on the team list page
Given I follow "Edit"
And I uncheck "Name Visible to Other Teams"
And I press "Update Information"
And I am on the teams page
And I am on the team list page
Then I should not see "Sahai"

2 changes: 1 addition & 1 deletion features/users/prevent_spam.feature
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ Feature: Prevent Spam
| Jorge | legueoflegends667@hotmail.com | 0 | Football Player | 999 | |
Given I am on the home page
Given I log in as a user with email "legueoflegends667@hotmail.com"
And I am on the teams page
And I am on the team list page

Scenario: User can still email
Given I contact "Team 1" with the message "I would like to join your team"
Expand Down
2 changes: 1 addition & 1 deletion features/users/view_teams.feature
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,6 @@ Feature: view teams
Scenario: A user is looking for a team
Given I am on the home page
Given I log in as a user with email "justanotheremail@aol.com"
And I am on the teams page
And I am on the team list page
And I should see "2"
And I should see "JavaScript, Back-end"