diff --git a/app/controllers/people_controller.rb b/app/controllers/people_controller.rb index 3c8317cc4..493eba348 100644 --- a/app/controllers/people_controller.rb +++ b/app/controllers/people_controller.rb @@ -26,12 +26,12 @@ def show @person = Person.includes(projects: :project_technologies, person_roles: [:role, :person_role_level]).find(@person.id) - Ptime::UpdatePersonData.new.update_person_data(@person) + Ptime::PeopleEmployees.new.update_person_data(@person) super end def new - @person = Ptime::UpdatePersonData.new.create_person(params[:ptime_employee_id]) + @person = Ptime::PeopleEmployees.new.create_person(params[:ptime_employee_id]) # (%w[DE EN FR] - @person.language_skills.pluck(:language)).each do |language| # @person.language_skills.push(LanguageSkill.new({ language: language, level: 'A1' })) # end diff --git a/app/domain/ptime/update_person_data.rb b/app/domain/ptime/people_employees.rb similarity index 98% rename from app/domain/ptime/update_person_data.rb rename to app/domain/ptime/people_employees.rb index e296db278..1a6a7217d 100644 --- a/app/domain/ptime/update_person_data.rb +++ b/app/domain/ptime/people_employees.rb @@ -1,5 +1,5 @@ module Ptime - class UpdatePersonData + class PeopleEmployees def create_person(ptime_employee_id) raise 'No ptime_employee_id provided' unless ptime_employee_id diff --git a/spec/domain/ptime/update_person_data_spec.rb b/spec/domain/ptime/people_employees_spec.rb similarity index 75% rename from spec/domain/ptime/update_person_data_spec.rb rename to spec/domain/ptime/people_employees_spec.rb index c3095609f..b30d2752a 100644 --- a/spec/domain/ptime/update_person_data_spec.rb +++ b/spec/domain/ptime/people_employees_spec.rb @@ -1,6 +1,6 @@ require 'rails_helper' -describe Ptime::UpdatePersonData do +describe Ptime::PeopleEmployees do ptime_base_test_url = "www.ptime.example.com" ptime_api_test_username = "test username" ptime_api_test_password = "test password" @@ -11,7 +11,7 @@ end it 'should raise error when no ptime_employee_id is passed to new action' do - expect{ Ptime::UpdatePersonData.new.create_person(nil) }.to raise_error(RuntimeError, 'No ptime_employee_id provided') + expect{ Ptime::PeopleEmployees.new.create_person(nil) }.to raise_error(RuntimeError, 'No ptime_employee_id provided') end it 'should return person if it has the given ptime_employee_id' do @@ -19,7 +19,7 @@ person_wally.ptime_employee_id = 123 person_wally.save! - new_person = Ptime::UpdatePersonData.new.create_person(person_wally.ptime_employee_id) + new_person = Ptime::PeopleEmployees.new.create_person(person_wally.ptime_employee_id) expect(person_wally.attributes.except(*%w[created_at updated_at])).to eql(new_person.attributes.except(*%w[created_at updated_at])) end @@ -31,6 +31,6 @@ person_wally = people(:wally) person_wally.ptime_employee_id = 50 person_wally.save! - expect{ Ptime::UpdatePersonData.new.update_person_data(person_wally) }.to raise_error(RuntimeError, 'Ptime_employee with ptime_employee_id 50 not found') + expect{ Ptime::PeopleEmployees.new.update_person_data(person_wally) }.to raise_error(RuntimeError, 'Ptime_employee with ptime_employee_id 50 not found') end end \ No newline at end of file diff --git a/spec/features/update_person_data_spec.rb b/spec/features/people_employees_spec.rb similarity index 99% rename from spec/features/update_person_data_spec.rb rename to spec/features/people_employees_spec.rb index 7b6335a7b..ea88eb471 100644 --- a/spec/features/update_person_data_spec.rb +++ b/spec/features/people_employees_spec.rb @@ -1,6 +1,6 @@ require 'rails_helper' -describe Ptime::UpdatePersonData do +describe Ptime::PeopleEmployees do ptime_base_test_url = "www.ptime.example.com" ptime_api_test_username = "test username" ptime_api_test_password = "test password"