model_citizen 0.0.5 → 0.0.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 4bc5e3aa17583826ceda631c7d3b90b8b276f117
4
- data.tar.gz: 235c080c4e945208f5d9b0a0bbf2d21766acee79
3
+ metadata.gz: 3bc4e6c31d7ad4a3e168e3ce96b5e0177ed77e22
4
+ data.tar.gz: 684aac0117de260f271e1d355d82963c8c437585
5
5
  SHA512:
6
- metadata.gz: 6453dfc59687b9e815eff1c792fa8c8529c8d3c7de0a44d1ac4db8896474dbf5671e5365e012de13629b621e0407f115c4446032aaa7da5bd4a7e214c687e11c
7
- data.tar.gz: 5085e64d7a9589f55de7caeef136390d8c10f4e75740f623ae11b7ff7f9e8227934ca4ca85f49a3cf15265575ce73f3975eca312521e87b390e8e8e5d5c93a60
6
+ metadata.gz: 5d10dd098d6018d23cbf1db1a7cf94c4a157df4c27f585ca86f5c54396958c0da5c30f75ac241042172fd0331d389ee60bac9bbcf0f24b4c27585062be52bda4
7
+ data.tar.gz: 76cfe3c7a1b809af2611ee126f8b8d403b0c0477a5a81c8479989c1fc67cdb28043c16a0488c8db30c42ac99edfd6227b39849059eff49938df0eaff5a1ef56d
@@ -4,32 +4,17 @@ module ModelCitizen
4
4
  attr_reader :messages
5
5
 
6
6
  def initialize
7
- @messages = {"username_prompt" => "Please enter your username to get started",
8
- "choose_action" => "Please select what you'd like to do" ,
9
- "invalid_username" => "That is not a valid username, please try again",
10
- "invalid_timesheet" => "That is not a valid timesheet, please try again",
11
- "invalid_client" => "That is not a valid client, please try again",
12
- "invalid_employee" => "That is not a valid employee, please try again",
13
- "timesheet_success" => "Your timesheet has been successfully saved",
14
- "client_success" => "Client has been saved",
15
- "employee_success" => "Employee has been saved",
16
- "invalid_choice" => "That is not a valid choice, please try again",
17
- "enter_billing_type" => "Please enter project type",
18
- "enter_employee_first" => "Please enter employee first name",
19
- "enter_employee_last" => "Please enter employee last name",
20
- "enter_employee_username" => "Please enter employee username",
21
- "enter_employee_type" => "Please enter employee type (admin or non-admin)",
22
- "enter_client_name" => "Please enter client name",
23
- "enter_client_type" => "Please enter client type (if regular client, please enter 'standard')",
24
- "enter_date" => "Please input the project date using this format : YYYY/MM/DD",
25
- "future_date_error" => "You cannot log time for the future, please select a different date",
26
- "enter_hours" => "Please input hours worked",
27
- "log_time" => "Log time",
28
- "request_report" => "Request time report",
29
- "add_employee" => "Add employee",
30
- "add_client" => "Add client",
31
- "no_time_to_display" => "No time to display for this month",
32
- "request_employee_report" => "Request employee report"}
7
+ @messages = {
8
+ :invalid_username => "That is not a valid username, please try again",
9
+ :invalid_timesheet => "That is not a valid timesheet, please try again",
10
+ :invalid_client => "That is not a valid client, please try again",
11
+ :invalid_employee => "That is not a valid employee, please try again",
12
+ :timesheet_success => "Your timesheet has been successfully saved",
13
+ :client_success => "Client has been successfully saved",
14
+ :employee_success => "Employee has been successfully saved",
15
+ :future_date_error => "You cannot log time for the future, please select a different date",
16
+ :no_time_to_display => "No time to display for this month",
17
+ }
33
18
  end
34
19
 
35
20
  def get_message(message_choice)
@@ -1,3 +1,3 @@
1
1
  module ModelCitizen
2
- VERSION = "0.0.5"
2
+ VERSION = "0.0.6"
3
3
  end
@@ -2,65 +2,49 @@ require "spec_helper"
2
2
 
3
3
  describe ModelCitizen::Messages do
4
4
 
5
- context "displaying messages" do
6
- it "should return a prompt to enter username" do
7
- type_validator = ModelCitizen::Messages.new.get_message("username_prompt")
8
- expect(type_validator).to eq("Please enter your username to get started")
9
- end
10
-
11
- it "should return a choose action message" do
12
- type_validator = ModelCitizen::Messages.new.get_message("choose_action")
13
- expect(type_validator).to eq("Please select what you'd like to do")
14
- end
5
+ context "displaying error messages" do
15
6
 
16
- it "should return an error message" do
17
- type_validator = ModelCitizen::Messages.new.get_message("invalid_choice")
18
- expect(type_validator).to eq("That is not a valid choice, please try again")
7
+ it "should return an error if username is invalid" do
8
+ type_validator = ModelCitizen::Messages.new.get_message(:invalid_username)
9
+ expect(type_validator).to eq("That is not a valid username, please try again")
19
10
  end
20
11
 
21
- it "should return a prompt to enter employee first name" do
22
- type_validator = ModelCitizen::Messages.new.get_message("enter_employee_first")
23
- expect(type_validator).to eq("Please enter employee first name")
12
+ it "should return an error if timesheet is invalid" do
13
+ type_validator = ModelCitizen::Messages.new.get_message(:invalid_timesheet)
14
+ expect(type_validator).to eq("That is not a valid timesheet, please try again")
24
15
  end
25
16
 
26
- it "should return a prompt to enter employee last name" do
27
- type_validator = ModelCitizen::Messages.new.get_message("enter_employee_last")
28
- expect(type_validator).to eq("Please enter employee last name")
17
+ it "should return an error if client is invalid" do
18
+ type_validator = ModelCitizen::Messages.new.get_message(:invalid_client)
19
+ expect(type_validator).to eq("That is not a valid client, please try again")
29
20
  end
30
21
 
31
- it "should return a prompt tp enter employee username" do
32
- type_validator = ModelCitizen::Messages.new.get_message("enter_employee_username")
33
- expect(type_validator).to eq("Please enter employee username")
22
+ it "should return an error if employee is invalid" do
23
+ type_validator = ModelCitizen::Messages.new.get_message(:invalid_employee)
24
+ expect(type_validator).to eq("That is not a valid employee, please try again")
34
25
  end
35
26
 
36
- it "should return a prompt to enter employee type" do
37
- type_validator = ModelCitizen::Messages.new.get_message("enter_employee_type")
38
- expect(type_validator).to eq("Please enter employee type (admin or non-admin)")
39
- end
40
-
41
- it "should return a prompt to enter client name" do
42
- type_validator = ModelCitizen::Messages.new.get_message("enter_client_name")
43
- expect(type_validator).to eq("Please enter client name")
27
+ it "should return an error for logging time in the future" do
28
+ type_validator = ModelCitizen::Messages.new.get_message(:future_date_error)
29
+ expect(type_validator).to eq("You cannot log time for the future, please select a different date")
44
30
  end
31
+ end
45
32
 
46
- it "should return a prompt for client type" do
47
- type_validator = ModelCitizen::Messages.new.get_message("enter_client_type")
48
- expect(type_validator).to eq("Please enter client type (if regular client, please enter 'standard')")
49
- end
33
+ context "displaying success messages" do
50
34
 
51
- it "should return a prompt to input the date" do
52
- type_validator = ModelCitizen::Messages.new.get_message("enter_date")
53
- expect(type_validator).to eq("Please input the project date using this format : YYYY/MM/DD")
35
+ it "should return a success message if timesheet is valid" do
36
+ type_validator = ModelCitizen::Messages.new.get_message(:timesheet_success)
37
+ expect(type_validator).to eq("Your timesheet has been successfully saved")
54
38
  end
55
39
 
56
- it "should return an error for logging time in the future" do
57
- type_validator = ModelCitizen::Messages.new.get_message("future_date_error")
58
- expect(type_validator).to eq("You cannot log time for the future, please select a different date")
40
+ it "should return a success message if client is valid" do
41
+ type_validator = ModelCitizen::Messages.new.get_message(:client_success)
42
+ expect(type_validator).to eq("Client has been successfully saved")
59
43
  end
60
44
 
61
- it "should return a prompt for hours" do
62
- type_validator = ModelCitizen::Messages.new.get_message("enter_hours")
63
- expect(type_validator).to eq("Please input hours worked")
45
+ it "should return a success message if employee is valid" do
46
+ type_validator = ModelCitizen::Messages.new.get_message(:employee_success)
47
+ expect(type_validator).to eq("Employee has been successfully saved")
64
48
  end
65
49
  end
66
50
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: model_citizen
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.5
4
+ version: 0.0.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - Sylwia Olak
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-02-15 00:00:00.000000000 Z
11
+ date: 2015-02-17 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler