Skip to content

Commit 69bcc49

Browse files
committed
Converted CMS role names to lowercase, in conformance to ADAUsers practice.
1 parent a3067ee commit 69bcc49

File tree

8 files changed

+19
-19
lines changed

8 files changed

+19
-19
lines changed

app/models/user.rb

+7-7
Original file line numberDiff line numberDiff line change
@@ -57,17 +57,17 @@ def to_s
5757

5858
def is_staff?
5959
(roles & [Inkling::Role.find_by_name("administrator"),
60-
Inkling::Role.find_by_name("Manager"),
61-
Inkling::Role.find_by_name("Publisher"),
62-
Inkling::Role.find_by_name("Approver"),
63-
Inkling::Role.find_by_name("Archivist")]).any?
60+
Inkling::Role.find_by_name("manager"),
61+
Inkling::Role.find_by_name("publisher"),
62+
Inkling::Role.find_by_name("approver"),
63+
Inkling::Role.find_by_name("archivist")]).any?
6464
end
6565

6666
def can_approve?
6767
(roles & [Inkling::Role.find_by_name("administrator"),
68-
Inkling::Role.find_by_name("Manager"),
69-
Inkling::Role.find_by_name("Publisher"),
70-
Inkling::Role.find_by_name("Approver")]).any?
68+
Inkling::Role.find_by_name("manager"),
69+
Inkling::Role.find_by_name("publisher"),
70+
Inkling::Role.find_by_name("approver")]).any?
7171
end
7272

7373
private

db/bootstrap/development/inkling_roles.yml

+4-4
Original file line numberDiff line numberDiff line change
@@ -6,21 +6,21 @@ inkling_roles_001:
66
updated_at: 2010-11-24 09:15:14.160774
77
inkling_roles_002:
88
id: "2"
9-
name: Manager
9+
name: manager
1010
created_at: 2010-11-24 09:15:14.516856
1111
updated_at: 2010-11-24 09:15:14.516856
1212
inkling_roles_003:
1313
id: "3"
14-
name: Approver
14+
name: approver
1515
created_at: 2010-11-24 09:15:14.520097
1616
updated_at: 2010-11-24 09:15:14.520097
1717
inkling_roles_004:
1818
id: "4"
19-
name: Archivist
19+
name: archivist
2020
created_at: 2010-11-24 09:15:14.522976
2121
updated_at: 2010-11-24 09:15:14.522976
2222
inkling_roles_005:
2323
id: "5"
24-
name: Member
24+
name: member
2525
created_at: 2010-11-24 09:15:14.525827
2626
updated_at: 2010-11-24 09:15:14.525827

spec/acceptance/staff/archives/pages_spec.rb

+1-1
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@
5858

5959
context "archivist" do
6060
background do
61-
@archivisit = make_user('Archivist')
61+
@archivisit = make_user('archivist')
6262
sign_in(@archivisit)
6363
end
6464

spec/acceptance/staff/news_spec.rb

+1-1
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@
5353

5454
context "archivist" do
5555
background do
56-
@archivisit = make_user('Archivist')
56+
@archivisit = make_user('archivist')
5757
sign_in(@archivisit)
5858
end
5959

spec/lib/workflowable_spec.rb

+2-2
Original file line numberDiff line numberDiff line change
@@ -17,15 +17,15 @@
1717
end
1818

1919
specify "that only permitted roles are allowed to put a worklowable into the published state" do
20-
["administrator", "Manager", "Publisher", "Approver"].each do |role_name|
20+
["administrator", "manager", "publisher", "approver"].each do |role_name|
2121
@workflowable.draft?.should == true
2222
user = make_user(role_name)
2323
@workflowable.publish!(user)
2424
@workflowable.published?.should == true
2525
@workflowable.draft!
2626
end
2727

28-
user = make_user("Archivist")
28+
user = make_user("archivist")
2929
@workflowable.publish!(user).should == false
3030
end
3131
end

spec/models/page_spec.rb

+1-1
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@
6767
context "Page object lifecycle should trigger appropriate moments in a matching menu item" do
6868
specify "when a page is published its menu_item should be published too" do
6969
p = Page.make
70-
approver = make_user('Approver')
70+
approver = make_user('approver')
7171
p.publish!(approver)
7272
p.menu_item.published?.should == true
7373
end

spec/models/user_spec.rb

+1-1
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
end
1515

1616
specify "that archivists cannot approve workflowables" do
17-
archivist = make_user("Archivist")
17+
archivist = make_user("archivist")
1818
archivist.can_approve?.should be_false
1919
end
2020
end

spec/support/javascript.rb

+2-2
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020

2121
config.before(:each, :type => :acceptance) do
2222
#this is messy ... just hacking at getting specs working
23-
["administrator", "Manager", "Publisher", "Approver", "Archivist"].each do |role_name|
23+
["administrator", "manager", "publisher", "approver", "archivist"].each do |role_name|
2424
Inkling::Role.create!(:name => role_name) if Inkling::Role.find_by_name(role_name).nil?
2525
end
2626

@@ -46,4 +46,4 @@
4646
Capybara.use_default_driver if example.metadata[:js]
4747
DatabaseCleaner.clean
4848
end
49-
end
49+
end

0 commit comments

Comments
 (0)