model_citizen 0.0.3 → 0.0.4
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 +4 -4
- data/lib/model_citizen/messages.rb +24 -11
- data/lib/model_citizen/version.rb +1 -1
- data/spec/messages_spec.rb +10 -10
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: b447f5eec5918537aeb37c76501a1ceaf6df4a27
|
4
|
+
data.tar.gz: c3129cd23b424f84c0b2d0a9a5be05fbc5407cac
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 835df6285a00048859f44b7ac72d00163872038c80e53b7d00734318f6c70f9dd79fd0724e752c4b2aaf84233eb5d2e167509053ccadb7f633c3a9802036c221
|
7
|
+
data.tar.gz: 4f4b13480fd661abdf55fdded025370db8323261287107d63dab37fefe48bf75c461cd621df24eac8f4e49297c90f3cff558dc2e4f9fc876b7c2ac61592b6587
|
@@ -4,18 +4,31 @@ module ModelCitizen
|
|
4
4
|
attr_reader :messages
|
5
5
|
|
6
6
|
def initialize
|
7
|
-
@messages = {"username_prompt" => "Please enter your username
|
8
|
-
"choose_action" => "Please select what you'd like to do
|
9
|
-
"
|
10
|
-
"
|
11
|
-
"
|
12
|
-
"
|
13
|
-
"
|
14
|
-
"
|
15
|
-
"
|
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_employee_first" => "Please enter employee first name",
|
18
|
+
"enter_employee_last" => "Please enter employee last name",
|
19
|
+
"enter_employee_username" => "Please enter employee username",
|
20
|
+
"enter_employee_type" => "Please enter employee type (admin or non-admin)",
|
21
|
+
"enter_client_name" => "Please enter client name",
|
22
|
+
"enter_client_type" => "Please enter client type (if regular client, please enter 'standard')",
|
16
23
|
"enter_date" => "Please input the project date using this format : YYYY/MM/DD",
|
17
|
-
"future_date_error" => "You cannot log time for the future, please select a different date
|
18
|
-
"enter_hours" => "Please input hours worked"
|
24
|
+
"future_date_error" => "You cannot log time for the future, please select a different date",
|
25
|
+
"enter_hours" => "Please input hours worked",
|
26
|
+
"log_time" => "Log time",
|
27
|
+
"request_report" => "Request time report",
|
28
|
+
"add_employee" => "Add employee",
|
29
|
+
"add_client" => "Add client",
|
30
|
+
"no_time_to_display" => "No time to display for this month",
|
31
|
+
"request_employee_report" => "Request employee report"}
|
19
32
|
end
|
20
33
|
|
21
34
|
def get_message(message_choice)
|
data/spec/messages_spec.rb
CHANGED
@@ -5,47 +5,47 @@ describe ModelCitizen::Messages do
|
|
5
5
|
context "displaying messages" do
|
6
6
|
it "should return a prompt to enter username" do
|
7
7
|
type_validator = ModelCitizen::Messages.new.get_message("username_prompt")
|
8
|
-
expect(type_validator).to eq("Please enter your username
|
8
|
+
expect(type_validator).to eq("Please enter your username to get started")
|
9
9
|
end
|
10
10
|
|
11
11
|
it "should return a choose action message" do
|
12
12
|
type_validator = ModelCitizen::Messages.new.get_message("choose_action")
|
13
|
-
expect(type_validator).to eq("Please select what you'd like to do
|
13
|
+
expect(type_validator).to eq("Please select what you'd like to do")
|
14
14
|
end
|
15
15
|
|
16
16
|
it "should return an error message" do
|
17
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
|
18
|
+
expect(type_validator).to eq("That is not a valid choice, please try again")
|
19
19
|
end
|
20
20
|
|
21
21
|
it "should return a prompt to enter employee first name" do
|
22
22
|
type_validator = ModelCitizen::Messages.new.get_message("enter_employee_first")
|
23
|
-
expect(type_validator).to eq("Please enter employee first name
|
23
|
+
expect(type_validator).to eq("Please enter employee first name")
|
24
24
|
end
|
25
25
|
|
26
26
|
it "should return a prompt to enter employee last name" do
|
27
27
|
type_validator = ModelCitizen::Messages.new.get_message("enter_employee_last")
|
28
|
-
expect(type_validator).to eq("Please enter employee last name
|
28
|
+
expect(type_validator).to eq("Please enter employee last name")
|
29
29
|
end
|
30
30
|
|
31
31
|
it "should return a prompt tp enter employee username" do
|
32
32
|
type_validator = ModelCitizen::Messages.new.get_message("enter_employee_username")
|
33
|
-
expect(type_validator).to eq("Please enter employee username
|
33
|
+
expect(type_validator).to eq("Please enter employee username")
|
34
34
|
end
|
35
35
|
|
36
36
|
it "should return a prompt to enter employee type" do
|
37
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)
|
38
|
+
expect(type_validator).to eq("Please enter employee type (admin or non-admin)")
|
39
39
|
end
|
40
40
|
|
41
41
|
it "should return a prompt to enter client name" do
|
42
42
|
type_validator = ModelCitizen::Messages.new.get_message("enter_client_name")
|
43
|
-
expect(type_validator).to eq("Please enter client name
|
43
|
+
expect(type_validator).to eq("Please enter client name")
|
44
44
|
end
|
45
45
|
|
46
46
|
it "should return a prompt for client type" do
|
47
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')
|
48
|
+
expect(type_validator).to eq("Please enter client type (if regular client, please enter 'standard')")
|
49
49
|
end
|
50
50
|
|
51
51
|
it "should return a prompt to input the date" do
|
@@ -55,7 +55,7 @@ describe ModelCitizen::Messages do
|
|
55
55
|
|
56
56
|
it "should return an error for logging time in the future" do
|
57
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
|
58
|
+
expect(type_validator).to eq("You cannot log time for the future, please select a different date")
|
59
59
|
end
|
60
60
|
|
61
61
|
it "should return a prompt for hours" do
|
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.
|
4
|
+
version: 0.0.4
|
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-
|
11
|
+
date: 2015-02-15 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|