diff --git a/app/controllers/projects_controller.rb b/app/controllers/projects_controller.rb index 03d5c04..7353b9e 100644 --- a/app/controllers/projects_controller.rb +++ b/app/controllers/projects_controller.rb @@ -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], diff --git a/app/models/user.rb b/app/models/user.rb index ffd0323..cf126cf 100644 --- a/app/models/user.rb +++ b/app/models/user.rb @@ -16,7 +16,7 @@ class User < ActiveRecord::Base - ROLES = ["admin", "developer", "customer"] + ROLES = ["admin", "developer", "client"] include Authentication include Authentication::ByPassword diff --git a/test/blueprints.rb b/test/blueprints.rb index 90f8cbb..d2580ca 100644 --- a/test/blueprints.rb +++ b/test/blueprints.rb @@ -25,7 +25,7 @@ User.blueprint do login email - role { "customer" } + role { "client" } password { 'monkey' } password_confirmation { 'monkey' } end diff --git a/test/functional/projects_controller_test.rb b/test/functional/projects_controller_test.rb index bfbfea2..135e415 100644 --- a/test/functional/projects_controller_test.rb +++ b/test/functional/projects_controller_test.rb @@ -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 diff --git a/test/unit/user_test.rb b/test/unit/user_test.rb index d60d2b5..7d8ee9a 100644 --- a/test/unit/user_test.rb +++ b/test/unit/user_test.rb @@ -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