Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Changed customer role name to client to reflect frontend change and s…

…ubsequent bug
  • Loading branch information...
commit b66b6c384514151f8e9723c5299a79a17ee51a7c 1 parent c76bfce
Steve authored
2  app/controllers/projects_controller.rb
View
@@ -6,7 +6,7 @@ class ProjectsController < ApplicationController
def index
if current_user
- if current_user.role == 'customer'
+ if current_user.role == 'client'
@projects = Project.find(:all,
:select => "DISTINCT projects.name, projects.*",
:conditions => ["participations.user_id = ?", current_user.to_param],
2  app/models/user.rb
View
@@ -16,7 +16,7 @@
class User < ActiveRecord::Base
- ROLES = ["admin", "developer", "customer"]
+ ROLES = ["admin", "developer", "client"]
include Authentication
include Authentication::ByPassword
2  test/blueprints.rb
View
@@ -25,7 +25,7 @@
User.blueprint do
login
email
- role { "customer" }
+ role { "client" }
password { 'monkey' }
password_confirmation { 'monkey' }
end
8 test/functional/projects_controller_test.rb
View
@@ -7,7 +7,7 @@ class ProjectsControllerTest < ActionController::TestCase
setup do
@project = Project.make
@admin = User.make(:admin)
- @customer = User.make(:role => 'customer')
+ @client = User.make(:role => 'client')
login_as(@admin)
end
@@ -29,7 +29,7 @@ class ProjectsControllerTest < ActionController::TestCase
context 'GET to index as a non-participating user' do
setup do
- login_as(@customer)
+ login_as(@client)
get :index
end
should "not show projects where the current user is not a participant" do
@@ -41,10 +41,10 @@ class ProjectsControllerTest < ActionController::TestCase
setup do
3.times do
iteration = Iteration.make
- iteration.geeks << @customer
+ iteration.geeks << @client
@project.iterations << iteration
end
- login_as(@customer)
+ login_as(@client)
get :index
end
should "not show projects where the current user is not a participant" do
6 test/unit/user_test.rb
View
@@ -9,7 +9,7 @@ class UserTest < ActiveSupport::TestCase
context "the User class" do
should "have a ROLES array in a constant" do
- assert_equal(["admin", "developer", "customer"], User::ROLES)
+ assert_equal(["admin", "developer", "client"], User::ROLES)
end
@@ -213,8 +213,8 @@ class UserTest < ActiveSupport::TestCase
@quentin = User.make(:quentin)
end
- should "have the role 'customer'" do
- assert @quentin.has_role?("customer")
+ should "have the role 'client'" do
+ assert @quentin.has_role?("client")
end
context "when setting the user's role" do
Please sign in to comment.
Something went wrong with that request. Please try again.