noodall-ui 0.0.11 → 0.0.12

Sign up to get free protection for your applications and to get access to all the features.
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- noodall-ui (0.0.11)
4
+ noodall-ui (0.0.12)
5
5
  dynamic_form
6
6
  noodall-core
7
7
  thoughtbot-sortable_table (= 0.0.6)
@@ -40,7 +40,7 @@ GEM
40
40
  activesupport (3.0.1)
41
41
  arel (1.0.1)
42
42
  activesupport (~> 3.0.0)
43
- bson (1.1.1)
43
+ bson (1.1.2)
44
44
  builder (2.1.2)
45
45
  canable (0.1.1)
46
46
  capybara (0.4.0)
@@ -52,11 +52,11 @@ GEM
52
52
  rack-test (>= 0.5.4)
53
53
  selenium-webdriver (>= 0.0.27)
54
54
  xpath (~> 0.1.2)
55
- celerity (0.8.2)
56
- childprocess (0.1.3)
55
+ celerity (0.8.4)
56
+ childprocess (0.1.4)
57
57
  ffi (~> 0.6.3)
58
- configuration (1.1.0)
59
- cucumber (0.9.3)
58
+ configuration (1.2.0)
59
+ cucumber (0.9.4)
60
60
  builder (~> 2.1.2)
61
61
  diff-lcs (~> 1.1.2)
62
62
  gherkin (~> 2.2.9)
@@ -84,7 +84,7 @@ GEM
84
84
  json (~> 1.4.6)
85
85
  term-ansicolor (~> 1.0.5)
86
86
  git (1.2.5)
87
- haml (3.0.23)
87
+ haml (3.0.24)
88
88
  i18n (0.4.2)
89
89
  jeweler (1.4.0)
90
90
  gemcutter (>= 0.1.0)
@@ -97,7 +97,7 @@ GEM
97
97
  launchy (0.3.7)
98
98
  configuration (>= 0.0.5)
99
99
  rake (>= 0.8.1)
100
- mail (2.2.9)
100
+ mail (2.2.10)
101
101
  activesupport (>= 2.3.6)
102
102
  i18n (~> 0.4.1)
103
103
  mime-types (~> 1.16)
@@ -105,13 +105,13 @@ GEM
105
105
  mime-types (1.16)
106
106
  mm-multi-parameter-attributes (0.1.1)
107
107
  mongo_mapper
108
- mongo (1.1.1)
108
+ mongo (1.1.2)
109
109
  bson (>= 1.1.1)
110
110
  mongo_mapper (0.8.6)
111
111
  activesupport (>= 2.3.4)
112
112
  jnunemaker-validatable (~> 1.8.4)
113
113
  plucky (~> 0.3.6)
114
- nokogiri (1.4.3.1)
114
+ nokogiri (1.4.4)
115
115
  noodall-core (0.3.2)
116
116
  canable (= 0.1.1)
117
117
  mm-multi-parameter-attributes (~> 0.1.1)
@@ -159,8 +159,8 @@ GEM
159
159
  rubyforge (2.0.4)
160
160
  json_pure (>= 1.1.7)
161
161
  rubyzip (0.9.4)
162
- selenium-webdriver (0.0.29)
163
- childprocess (>= 0.0.7)
162
+ selenium-webdriver (0.1.0)
163
+ childprocess (= 0.1.4)
164
164
  ffi (~> 0.6.3)
165
165
  json_pure
166
166
  rubyzip
@@ -168,7 +168,7 @@ GEM
168
168
  term-ansicolor (1.0.5)
169
169
  thor (0.14.4)
170
170
  thoughtbot-sortable_table (0.0.6)
171
- treetop (1.4.8)
171
+ treetop (1.4.9)
172
172
  polyglot (>= 0.3.1)
173
173
  tzinfo (0.3.23)
174
174
  will_paginate (3.0.pre2)
data/config/cucumber.yml CHANGED
@@ -6,3 +6,4 @@ std_opts = "--format #{ENV['CUCUMBER_FORMAT'] || 'progress'} --strict --tags ~@w
6
6
  default: --drb <%= std_opts %> features
7
7
  wip: --drb --tags @wip:3 --wip features
8
8
  rerun: --drb <%= rerun_opts %> --format rerun --out rerun.txt --strict --tags ~@wip
9
+ publish: --drb <%= std_opts %> --format Cucumber::Formatter::SevenFeatures --out public/features.html features
@@ -0,0 +1,27 @@
1
+ Feature: Groups access control
2
+ To control which users will be able to modify certain parts of the website a website administrator will be able to set the access level that groups have to branches of the content tree
3
+
4
+ Scenario: Set Content Permission
5
+ Given I am signed in as a website administrator
6
+ When I am editing content
7
+ Then I should be able to set the permissions on that content
8
+
9
+ Scenario Outline: Permissions
10
+ Given content's <Permission> is set to "staff" and "students"
11
+ Then only users in the "staff" and "students" should be able to <Actions> content
12
+ And users not in the "staff" and "students" should not be able to <Actions> content
13
+
14
+ Examples:
15
+ | Permission | Actions |
16
+ | Update | Update, create children of |
17
+ | Destroy | Delete |
18
+ | Publish | Publish |
19
+
20
+ Scenario: Inherited Permissions
21
+ Given content exists with permissions set
22
+ When a child of that content is created
23
+ Then by default the child should have the same permissions as it's parent
24
+
25
+ Scenario: Administrators
26
+ Given I am signed in as a website administrator
27
+ Then I should be able to carry out all actions regardless of group permissions
@@ -1,7 +1,7 @@
1
- @cms @wip
2
- Feature: PREVIEW CONTENT
1
+ Feature: Preview Content
3
2
  A preview function will allow a website editor to view how content will look before they save it
4
3
 
4
+ @javascript
5
5
  Scenario: Preview Content
6
6
  Given I am editing content
7
7
  And I click preview
@@ -1,5 +1,5 @@
1
1
  @website
2
- Feature: SITE MAP
2
+ Feature: Site Map
3
3
  In order to allow website visitors to see on overview of the entire site the website will
4
4
  provide a site map showing all content on the website
5
5
 
@@ -19,22 +19,22 @@ Then(/^only users in the "([^\"]*)" and "([^\"]*)" should be able to ([^\"]*) co
19
19
  actions.split(', ').each do |action|
20
20
  case action
21
21
  when "Update"
22
- visit admin_node_path(@_content)
22
+ visit noodall_admin_node_path(@_content)
23
23
  click_button "Draft"
24
24
  when "create children of"
25
- visit admin_node_nodes_path(@_content)
26
- click_link_within ".choices", "New"
25
+ visit noodall_admin_node_nodes_path(@_content)
26
+ within(".choices") { click_link "New" }
27
27
  click_button "Create"
28
28
  when "Delete"
29
- visit admin_nodes_path
30
- click_link_within "tr:contains('#{@_content.title}')", "Delete"
29
+ visit noodall_admin_nodes_path
30
+ within("tr:contains('#{@_content.title}')") { click_link "Delete" }
31
31
  # REcreate for the next run
32
32
  @_content = Factory(:page_a, "destroyable_groups" => [group1, group2])
33
33
  when "Publish"
34
- visit admin_node_path(@_content)
34
+ visit noodall_admin_node_path(@_content)
35
35
  begin
36
36
  click_button "Publish"
37
- rescue Webrat::NotFoundError => e
37
+ rescue Capybara::ElementNotFound => e
38
38
  raise Canable::Transgression # Raise this if we can't find the button
39
39
  end
40
40
  end
@@ -44,7 +44,23 @@ Then(/^only users in the "([^\"]*)" and "([^\"]*)" should be able to ([^\"]*) co
44
44
  end
45
45
 
46
46
  Then(/^users not in the "([^\"]*)" and "([^\"]*)" should not be able to ([^\"]*) content$/) do |group1, group2, action|
47
- lambda { Then %{only users in the "nongroup" and "anothergroup" should be able to #{action} content} }.should raise_error(Canable::Transgression)
47
+ Given %{I am signed in as a nogood}
48
+ case action
49
+ when "Update"
50
+ visit noodall_admin_node_path(@_content)
51
+ page.should have_content("You do not have permission to do that")
52
+ when "create children of"
53
+ visit noodall_admin_node_nodes_path(@_content)
54
+ within(".choices") { click_link "New" }
55
+ page.should have_content("You do not have permission to do that")
56
+ when "Delete"
57
+ visit noodall_admin_nodes_path
58
+ within("tr:contains('#{@_content.title}')") { click_link "Delete" }
59
+ page.should have_content("You do not have permission to do that")
60
+ when "Publish"
61
+ visit noodall_admin_node_path(@_content)
62
+ lambda { click_button "Publish" }.should raise_error(Capybara::ElementNotFound)
63
+ end
48
64
  end
49
65
 
50
66
  Given /^content exists with permissions set$/ do
@@ -53,25 +69,25 @@ end
53
69
 
54
70
  When /^a child of that content is created$/ do
55
71
  Given %{I am signed in as a website administrator}
56
- visit admin_node_nodes_path(@_content)
57
- click_link_within ".choices", "New"
72
+ visit noodall_admin_node_nodes_path(@_content)
73
+ within(".choices") { click_link "New" }
58
74
  fill_in "Title", :with => "Permeable Content"
59
75
  choose("Page A")
60
76
  click_button "Create"
61
77
  end
62
78
 
63
79
  Then(/^by default the child should have the same permissions as it's parent$/) do
64
- response.should have_css("input#node_updatable_groups_list") do |input|
80
+ page.should have_css("input#node_updatable_groups_list") do |input|
65
81
  input.should have_xpath("@value") do |value|
66
82
  value.should contain("Dudes")
67
83
  end
68
84
  end
69
- response.should have_css("input#node_destroyable_groups_list") do |input|
85
+ page.should have_css("input#node_destroyable_groups_list") do |input|
70
86
  input.should have_xpath("@value") do |value|
71
87
  value.should contain("Webbies, Dudes")
72
88
  end
73
89
  end
74
- response.should have_css("input#node_publishable_groups_list") do |input|
90
+ page.should have_css("input#node_publishable_groups_list") do |input|
75
91
  input.should have_xpath("@value") do |value|
76
92
  value.should contain("Dudes")
77
93
  end
@@ -80,13 +96,18 @@ end
80
96
 
81
97
  Then /^I should be able to carry out all actions regardless of group permissions$/ do
82
98
  Given %{content exists with permissions set}
83
- visit admin_node_path(@_content)
99
+ visit noodall_admin_node_path(@_content)
84
100
  click_button "Draft"
85
- visit admin_node_nodes_path(@_content)
86
- click_link_within ".choices", "New"
101
+ visit noodall_admin_node_nodes_path(@_content)
102
+ within(".choices") { click_link "New" }
87
103
  click_button "Create"
88
- visit admin_node_path(@_content)
104
+ visit noodall_admin_node_path(@_content)
89
105
  click_button "Publish"
90
- visit admin_nodes_path
91
- click_link_within "tr:contains('#{@_content.title}')", "Delete"
106
+ visit noodall_admin_nodes_path
107
+ within("tr:contains('#{@_content.title}')") { click_link "Delete" }
108
+ end
109
+
110
+ Then /^I sign out$/ do
111
+ # express the regexp above with the code you wish you had
92
112
  end
113
+
@@ -26,6 +26,5 @@ end
26
26
 
27
27
 
28
28
  Then /^I should see a page of xml$/ do
29
- save_and_open_page
30
29
  page.should have_xpath("//urlset")
31
- end
30
+ end
@@ -17,7 +17,8 @@ Then /^the content should (not |)be visible on the website$/ do |is_not|
17
17
  visit node_path(@_content)
18
18
  page.should within('h1') { have_content(@_content.title) }
19
19
  else
20
- lambda { visit node_path(@_content) }.should raise_error(MongoMapper::DocumentNotFound)
20
+ visit node_path(@_content)
21
+ page.should have_content("The page you were looking for doesn't exist.")
21
22
  end
22
23
  end
23
24
 
@@ -0,0 +1,251 @@
1
+ /* cucumber.css is generated from cucumber.sass */
2
+ /* Regenerate with rake sass */
3
+ body {
4
+ font-size: 0px;
5
+ color: #FFFFFF;
6
+ margin: 0px;
7
+ padding: 0px;
8
+ }
9
+
10
+ .cucumber, td, th {
11
+ font: normal 14px "Lucida Grande", Helvetica, sans-serif;
12
+ background: white;
13
+ color: #000000;
14
+ }
15
+ .cucumber #cucumber-header, td #cucumber-header, th #cucumber-header {
16
+ color: #65C400;
17
+ height: 5em;
18
+ }
19
+ .cucumber .background h3 {
20
+ padding: 7px 7px 0px;
21
+ margin: 0;
22
+ color: #000000;
23
+ font-weight: bold;
24
+ }
25
+ .cucumber .scenario h3, td .scenario h3, th .scenario h3 {
26
+ font-size: 14px;
27
+ padding: 14px 7px 2px;
28
+ margin: 0;
29
+ color: #65C400;
30
+ font-weight: bold;
31
+ }
32
+ .cucumber h1, td h1, th h1 {
33
+ margin: 0px 10px 0px 10px;
34
+ padding: 10px;
35
+ font-family: "Lucida Grande", Helvetica, sans-serif;
36
+ font-size: 1.8em;
37
+ position: absolute;
38
+ }
39
+ .cucumber h4, td h4, th h4 {
40
+ margin-bottom: 2px;
41
+ }
42
+ .cucumber div.feature, td div.feature, th div.feature {
43
+ padding: 2px;
44
+ margin: 0px 10px 5px 10px;
45
+ }
46
+ .cucumber div.examples, td div.examples, th div.examples {
47
+ padding: 0em 0em 0em 1em;
48
+ }
49
+ .cucumber .stats, td .stats, th .stats {
50
+ margin: 2em;
51
+ }
52
+ .cucumber .summary ul.features li, td .summary ul.features li, th .summary ul.features li {
53
+ display: inline;
54
+ }
55
+ .cucumber .tag, td .tag, th .tag {
56
+ font-weight: bold;
57
+ color: #246AC1;
58
+ }
59
+ .cucumber .backtrace, td .backtrace, th .backtrace {
60
+ margin-top: 0;
61
+ margin-bottom: 0;
62
+ margin-left: 1em;
63
+ color: #000000;
64
+ }
65
+ .cucumber a, td a, th a {
66
+ text-decoration: none;
67
+ color: #BE5C00;
68
+ }
69
+ .cucumber a:hover, td a:hover, th a:hover {
70
+ text-decoration: underline;
71
+ }
72
+ .cucumber a:visited, td a:visited, th a:visited {
73
+ font-weight: normal;
74
+ }
75
+ .cucumber a div.examples, td a div.examples, th a div.examples {
76
+ margin: 5px 0px 5px 15px;
77
+ color: #000000;
78
+ }
79
+ .cucumber .outline table, td .outline table, th .outline table {
80
+ margin: 0px 0px 5px 10px;
81
+ }
82
+ .cucumber table, td table, th table {
83
+ border-collapse: collapse;
84
+ }
85
+ .cucumber table td, td table td, th table td {
86
+ padding: 3px 3px 3px 5px;
87
+ }
88
+ .cucumber table td.failed, .cucumber table td.passed, .cucumber table td.skipped, .cucumber table td.pending, .cucumber table td.undefined, td table td.failed, td table td.passed, td table td.skipped, td table td.pending, td table td.undefined, th table td.failed, th table td.passed, th table td.skipped, th table td.pending, th table td.undefined {
89
+ padding-left: 18px;
90
+ padding-right: 10px;
91
+ background: white;
92
+ }
93
+ .cucumber table td.failed, td table td.failed, th table td.failed {
94
+ color: #c20000;
95
+ }
96
+ .cucumber table td.passed, td table td.passed, th table td.passed {
97
+ color: #3d7700;
98
+ }
99
+ .cucumber table td.skipped, td table td.skipped, th table td.skipped {
100
+ color: black;
101
+ }
102
+ .cucumber table td.pending, td table td.pending, th table td.pending {
103
+ color: black;
104
+ }
105
+ .cucumber table td.undefined, td table td.undefined, th table td.undefined {
106
+ color: black;
107
+ }
108
+ .cucumber ol, td ol, th ol {
109
+ list-style: none;
110
+ margin: 0px;
111
+ padding: 0px;
112
+ }
113
+ .cucumber ol li.step, td ol li.step, th ol li.step {
114
+ padding: 0px 0px 0px 18px;
115
+ margin: 0px 0px 0px 5px;
116
+ }
117
+ .cucumber ol li, td ol li, th ol li {
118
+ margin: 0em 0em 0em 1em;
119
+ padding: 0em 0em 0em 0.2em;
120
+ }
121
+ .cucumber ol li span.param, td ol li span.param, th ol li span.param {
122
+ font-weight: bold;
123
+ }
124
+ .cucumber ol li.failed, td ol li.failed, th ol li.failed {
125
+ background: white;
126
+ color: #c20000;
127
+ }
128
+ .cucumber ol li.passed, td ol li.passed, th ol li.passed {
129
+ background: white;
130
+ color: #3d7700;
131
+ }
132
+ .cucumber ol li.skipped, td ol li.skipped, th ol li.skipped {
133
+ background: white;
134
+ color: black;
135
+ }
136
+ .cucumber ol li.pending, td ol li.pending, th ol li.pending {
137
+ background: white;
138
+ color: black;
139
+ }
140
+ .cucumber ol li.undefined, td ol li.undefined, th ol li.undefined {
141
+ background: white;
142
+ color: black;
143
+ }
144
+ .cucumber #summary, td #summary, th #summary {
145
+ margin: 0px;
146
+ padding: 5px 10px;
147
+ text-align: right;
148
+ top: 0px;
149
+ right: 0px;
150
+ float: right;
151
+ }
152
+ .cucumber #summary p, td #summary p, th #summary p {
153
+ margin: 0 0 0 2px;
154
+ }
155
+ .cucumber #summary #totals, td #summary #totals, th #summary #totals {
156
+ font-size: 1.2em;
157
+ }
158
+
159
+ .ruby {
160
+ font-size: 12px;
161
+ font-family: monospace;
162
+ color: white;
163
+ background: black;
164
+ padding: 0.1em 0 0.2em 0;
165
+ }
166
+ .ruby .keyword {
167
+ color: #FF6600;
168
+ }
169
+ .ruby .constant {
170
+ color: #339999;
171
+ }
172
+ .ruby .attribute {
173
+ color: white;
174
+ }
175
+ .ruby .global {
176
+ color: white;
177
+ }
178
+ .ruby .module {
179
+ color: white;
180
+ }
181
+ .ruby .class {
182
+ color: white;
183
+ }
184
+ .ruby .string {
185
+ color: #66FF00;
186
+ }
187
+ .ruby .ident {
188
+ color: white;
189
+ }
190
+ .ruby .method {
191
+ color: #FFCC00;
192
+ }
193
+ .ruby .number {
194
+ color: white;
195
+ }
196
+ .ruby .char {
197
+ color: white;
198
+ }
199
+ .ruby .comment {
200
+ color: #9933CC;
201
+ }
202
+ .ruby .symbol {
203
+ color: white;
204
+ }
205
+ .ruby .regex {
206
+ color: #44B4CC;
207
+ }
208
+ .ruby .punct {
209
+ color: white;
210
+ }
211
+ .ruby .escape {
212
+ color: white;
213
+ }
214
+ .ruby .interp {
215
+ color: white;
216
+ }
217
+ .ruby .expr {
218
+ color: white;
219
+ }
220
+ .ruby .offending {
221
+ background: white;
222
+ }
223
+ .ruby .linenum {
224
+ width: 75px;
225
+ padding: 0.1em 1em 0.2em 0;
226
+ color: #000000;
227
+ background: white;
228
+ }
229
+
230
+ /*.collapsed > * {*/
231
+ /*display: none;}*/
232
+
233
+ /*.collapsed > h2,*/
234
+ /*.collapsed > h3 {*/
235
+ /*display: block;}*/
236
+
237
+ /*.feature > h2,*/
238
+ /*.scenario > h3 {*/
239
+ /*cursor: pointer;}*/
240
+
241
+ /*.feature > h2:before,*/
242
+ /*.scenario > h3:before {*/
243
+ /*content: '[-]';}*/
244
+
245
+ /*.collapsed > h2:before,*/
246
+ /*.collapsed > h3:before {*/
247
+ /*content: '[+]';}*/
248
+
249
+ #collapser {
250
+ font-weight: bold;
251
+ }