echo_base 0.0.1 → 0.0.2
Sign up to get free protection for your applications and to get access to all the features.
- data/.document +5 -0
- data/.gitignore +21 -3
- data/LICENSE +20 -0
- data/README.rdoc +17 -0
- data/Rakefile +51 -2
- data/VERSION +1 -0
- data/echo_base.gemspec +165 -15
- data/lib/echo_base.rb +0 -3
- data/lib/generators/echo_base/USAGE +5 -0
- data/lib/generators/echo_base/echo_base_generator.rb +44 -0
- data/lib/generators/echo_base/templates/.infinity_test +25 -0
- data/lib/generators/echo_base/templates/.rspec +1 -0
- data/lib/generators/echo_base/templates/.rvmrc +1 -0
- data/lib/generators/echo_base/templates/Capfile +4 -0
- data/lib/generators/echo_base/templates/Gemfile +37 -0
- data/lib/generators/echo_base/templates/Gemfile.lock +235 -0
- data/lib/generators/echo_base/templates/app/controllers/application_controller.rb +20 -0
- data/lib/generators/echo_base/templates/app/controllers/sessions_controller.rb +15 -0
- data/lib/generators/echo_base/templates/app/controllers/users_controller.rb +83 -0
- data/lib/generators/echo_base/templates/app/helpers/application_helper.rb +2 -0
- data/lib/generators/echo_base/templates/app/helpers/sessions_helper.rb +2 -0
- data/lib/generators/echo_base/templates/app/helpers/users_helper.rb +2 -0
- data/lib/generators/echo_base/templates/app/models/authorization.rb +14 -0
- data/lib/generators/echo_base/templates/app/models/user.rb +11 -0
- data/lib/generators/echo_base/templates/app/views/shared/_js.html.erb +14 -0
- data/lib/generators/echo_base/templates/app/views/users/_form.html.erb +37 -0
- data/lib/generators/echo_base/templates/app/views/users/_sidebar.html.erb +13 -0
- data/lib/generators/echo_base/templates/app/views/users/edit.html.erb +19 -0
- data/lib/generators/echo_base/templates/app/views/users/index.html.erb +48 -0
- data/lib/generators/echo_base/templates/app/views/users/new.html.erb +18 -0
- data/lib/generators/echo_base/templates/app/views/users/show.html.erb +44 -0
- data/lib/generators/echo_base/templates/application.html.erb +48 -0
- data/lib/generators/echo_base/templates/autotest/discover.rb +2 -0
- data/lib/generators/echo_base/templates/config/cucumber.yml +8 -0
- data/lib/generators/echo_base/templates/config/deploy.rb +24 -0
- data/lib/generators/echo_base/templates/config/environments/development.rb +26 -0
- data/lib/generators/echo_base/templates/config/environments/production.rb +50 -0
- data/lib/generators/echo_base/templates/config/environments/test.rb +35 -0
- data/lib/generators/echo_base/templates/config/initializers/hoptoad.rb +4 -0
- data/lib/generators/echo_base/templates/config/initializers/omniauth.rb +10 -0
- data/lib/generators/echo_base/templates/config/newrelic.yml.example +0 -0
- data/lib/generators/echo_base/templates/config/omniauth.yml.example +62 -0
- data/lib/generators/echo_base/templates/config/routes.rb +5 -0
- data/lib/generators/echo_base/templates/db/migrate/20101008210657_create_authorizations.rb +15 -0
- data/lib/generators/echo_base/templates/db/migrate/20101009192412_create_users.rb +17 -0
- data/lib/generators/echo_base/templates/features/manage_authentications.feature +45 -0
- data/lib/generators/echo_base/templates/features/manage_users.feature +45 -0
- data/lib/generators/echo_base/templates/features/step_definitions/authentication_steps.rb +14 -0
- data/lib/generators/echo_base/templates/features/step_definitions/users_steps.rb +14 -0
- data/lib/generators/echo_base/templates/features/step_definitions/web_steps.rb +219 -0
- data/lib/generators/echo_base/templates/features/support/env.rb +57 -0
- data/lib/generators/echo_base/templates/features/support/paths.rb +39 -0
- data/lib/generators/echo_base/templates/public/404.html +26 -0
- data/lib/generators/echo_base/templates/public/422.html +26 -0
- data/lib/generators/echo_base/templates/public/500.html +26 -0
- data/lib/generators/echo_base/templates/public/favicon.ico +0 -0
- data/lib/generators/echo_base/templates/public/images/web-app-theme/arrow.png +0 -0
- data/lib/generators/echo_base/templates/public/images/web-app-theme/avatar.png +0 -0
- data/lib/generators/echo_base/templates/public/images/web-app-theme/boxbar-background.png +0 -0
- data/lib/generators/echo_base/templates/public/images/web-app-theme/breadcrumb.png +0 -0
- data/lib/generators/echo_base/templates/public/images/web-app-theme/button-background-active.png +0 -0
- data/lib/generators/echo_base/templates/public/images/web-app-theme/button-background.png +0 -0
- data/lib/generators/echo_base/templates/public/images/web-app-theme/icons/24/about +12 -0
- data/lib/generators/echo_base/templates/public/images/web-app-theme/icons/24/anchor-hover.png +0 -0
- data/lib/generators/echo_base/templates/public/images/web-app-theme/icons/24/anchor.png +0 -0
- data/lib/generators/echo_base/templates/public/images/web-app-theme/icons/24/cross-hover.png +0 -0
- data/lib/generators/echo_base/templates/public/images/web-app-theme/icons/24/cross.png +0 -0
- data/lib/generators/echo_base/templates/public/images/web-app-theme/icons/24/download-hover.png +0 -0
- data/lib/generators/echo_base/templates/public/images/web-app-theme/icons/24/download.png +0 -0
- data/lib/generators/echo_base/templates/public/images/web-app-theme/icons/24/edit-hover.png +0 -0
- data/lib/generators/echo_base/templates/public/images/web-app-theme/icons/24/edit.png +0 -0
- data/lib/generators/echo_base/templates/public/images/web-app-theme/icons/24/export-hover.png +0 -0
- data/lib/generators/echo_base/templates/public/images/web-app-theme/icons/24/export.png +0 -0
- data/lib/generators/echo_base/templates/public/images/web-app-theme/icons/24/show-hover.png +0 -0
- data/lib/generators/echo_base/templates/public/images/web-app-theme/icons/24/show.png +0 -0
- data/lib/generators/echo_base/templates/public/images/web-app-theme/icons/add.png +0 -0
- data/lib/generators/echo_base/templates/public/images/web-app-theme/icons/application_edit.png +0 -0
- data/lib/generators/echo_base/templates/public/images/web-app-theme/icons/calendar-hover.png +0 -0
- data/lib/generators/echo_base/templates/public/images/web-app-theme/icons/calendar.png +0 -0
- data/lib/generators/echo_base/templates/public/images/web-app-theme/icons/cross.png +0 -0
- data/lib/generators/echo_base/templates/public/images/web-app-theme/icons/delete.png +0 -0
- data/lib/generators/echo_base/templates/public/images/web-app-theme/icons/download.png +0 -0
- data/lib/generators/echo_base/templates/public/images/web-app-theme/icons/edit.png +0 -0
- data/lib/generators/echo_base/templates/public/images/web-app-theme/icons/key.png +0 -0
- data/lib/generators/echo_base/templates/public/images/web-app-theme/icons/pdf.png +0 -0
- data/lib/generators/echo_base/templates/public/images/web-app-theme/icons/search.png +0 -0
- data/lib/generators/echo_base/templates/public/images/web-app-theme/icons/see-less.png +0 -0
- data/lib/generators/echo_base/templates/public/images/web-app-theme/icons/see-more.png +0 -0
- data/lib/generators/echo_base/templates/public/images/web-app-theme/icons/send-mail.png +0 -0
- data/lib/generators/echo_base/templates/public/images/web-app-theme/icons/show.png +0 -0
- data/lib/generators/echo_base/templates/public/images/web-app-theme/icons/source +1 -0
- data/lib/generators/echo_base/templates/public/images/web-app-theme/icons/tick.png +0 -0
- data/lib/generators/echo_base/templates/public/images/web-app-theme/icons/upload.png +0 -0
- data/lib/generators/echo_base/templates/public/images/web-app-theme/logo.png +0 -0
- data/lib/generators/echo_base/templates/public/images/web-app-theme/menubar-background.png +0 -0
- data/lib/generators/echo_base/templates/public/images/web-app-theme/search-button.png +0 -0
- data/lib/generators/echo_base/templates/public/images/web-app-theme/session/account.png +0 -0
- data/lib/generators/echo_base/templates/public/images/web-app-theme/session/config.png +0 -0
- data/lib/generators/echo_base/templates/public/images/web-app-theme/session/home.png +0 -0
- data/lib/generators/echo_base/templates/public/images/web-app-theme/session/logout.png +0 -0
- data/lib/generators/echo_base/templates/public/images/web-app-theme/tipsy.gif +0 -0
- data/lib/generators/echo_base/templates/public/javascripts/application.js +2 -0
- data/lib/generators/echo_base/templates/public/javascripts/dd_belatedpng.js +328 -0
- data/lib/generators/echo_base/templates/public/javascripts/jquery-1.4.2.min.js +154 -0
- data/lib/generators/echo_base/templates/public/javascripts/modernizr-1.5.min.js +28 -0
- data/lib/generators/echo_base/templates/public/javascripts/rails.js +132 -0
- data/lib/generators/echo_base/templates/public/robots.txt +5 -0
- data/lib/generators/echo_base/templates/public/stylesheets/.gitkeep +0 -0
- data/lib/generators/echo_base/templates/public/stylesheets/handheld.css +7 -0
- data/lib/generators/echo_base/templates/public/stylesheets/style.css +571 -0
- data/lib/generators/echo_base/templates/public/stylesheets/web-app-theme/base.css +397 -0
- data/lib/generators/echo_base/templates/public/stylesheets/web-app-theme/override.css +1 -0
- data/lib/generators/echo_base/templates/public/stylesheets/web-app-theme/themes/default/images/arrow.png +0 -0
- data/lib/generators/echo_base/templates/public/stylesheets/web-app-theme/themes/default/images/boxbar-background.png +0 -0
- data/lib/generators/echo_base/templates/public/stylesheets/web-app-theme/themes/default/images/button-background-active.png +0 -0
- data/lib/generators/echo_base/templates/public/stylesheets/web-app-theme/themes/default/images/button-background.png +0 -0
- data/lib/generators/echo_base/templates/public/stylesheets/web-app-theme/themes/default/images/menubar-background.png +0 -0
- data/lib/generators/echo_base/templates/public/stylesheets/web-app-theme/themes/default/style.css +466 -0
- data/lib/generators/echo_base/templates/spec/controllers/sessions_controller_spec.rb +5 -0
- data/lib/generators/echo_base/templates/spec/controllers/users_controller_spec.rb +125 -0
- data/lib/generators/echo_base/templates/spec/helpers/users_helper_spec.rb +15 -0
- data/lib/generators/echo_base/templates/spec/models/authorization_spec.rb +5 -0
- data/lib/generators/echo_base/templates/spec/models/user_spec.rb +5 -0
- data/lib/generators/echo_base/templates/spec/routing/users_routing_spec.rb +35 -0
- data/lib/generators/echo_base/templates/spec/spec_helper.rb +16 -0
- data/lib/generators/echo_base/templates/spec/views/users/edit.html.erb_spec.rb +27 -0
- data/lib/generators/echo_base/templates/spec/views/users/index.html.erb_spec.rb +36 -0
- data/lib/generators/echo_base/templates/spec/views/users/new.html.erb_spec.rb +27 -0
- data/lib/generators/echo_base/templates/spec/views/users/show.html.erb_spec.rb +27 -0
- data/test/helper.rb +10 -0
- data/test/test_echo_base.rb +7 -0
- metadata +145 -36
- data/Gemfile +0 -4
- data/lib/echo_base/version.rb +0 -3
data/lib/generators/echo_base/templates/public/stylesheets/web-app-theme/themes/default/style.css
ADDED
@@ -0,0 +1,466 @@
|
|
1
|
+
/*
|
2
|
+
activo
|
3
|
+
by David Francisco (dmfrancisc[at]gmail.com)
|
4
|
+
|
5
|
+
based on "Drastic Dark" by Juan Maria Martinez Arce (juan[at]insignia4u.com)
|
6
|
+
*/
|
7
|
+
|
8
|
+
.small {
|
9
|
+
font-size: 11px;
|
10
|
+
font-style: normal;
|
11
|
+
font-weight: normal;
|
12
|
+
text-transform: none;
|
13
|
+
letter-spacing: normal;
|
14
|
+
line-height: 1.4em;
|
15
|
+
}
|
16
|
+
|
17
|
+
.gray {
|
18
|
+
color:#999999;
|
19
|
+
font-family: Georgia, serif;
|
20
|
+
font-size: 13px;
|
21
|
+
font-style: italic;
|
22
|
+
font-weight: normal;
|
23
|
+
text-transform: none;
|
24
|
+
letter-spacing: normal;
|
25
|
+
line-height: 1.6em;
|
26
|
+
}
|
27
|
+
|
28
|
+
.hightlight {
|
29
|
+
background-color: #ffff88;
|
30
|
+
font-weight: bold;
|
31
|
+
color: #36393d;
|
32
|
+
}
|
33
|
+
|
34
|
+
a:link, a:visited, a:hover, a:active, h1, h2, h3 { color: #111; }
|
35
|
+
a { -moz-outline: none; }
|
36
|
+
|
37
|
+
body {
|
38
|
+
color: #111;
|
39
|
+
background: #f4f4f4;
|
40
|
+
font-family: helvetica, arial, sans-serif;
|
41
|
+
}
|
42
|
+
|
43
|
+
hr {
|
44
|
+
background: #e2e2e2;
|
45
|
+
color: #e2e2e2;
|
46
|
+
}
|
47
|
+
|
48
|
+
#header {
|
49
|
+
background: #261f1f;
|
50
|
+
}
|
51
|
+
|
52
|
+
#header h1 {
|
53
|
+
padding: 15px 0;
|
54
|
+
font-size: 32px;
|
55
|
+
font-style: normal;
|
56
|
+
font-weight: bold;
|
57
|
+
text-transform: none;
|
58
|
+
letter-spacing: -1px;
|
59
|
+
line-height: 1.2em;
|
60
|
+
color: #fff;
|
61
|
+
text-shadow: #000 1px 1px 2px;
|
62
|
+
}
|
63
|
+
|
64
|
+
#header h1 a:link, #header h1 a:active, #header h1 a:hover, #header h1 a:visited {
|
65
|
+
color: #fff;
|
66
|
+
}
|
67
|
+
|
68
|
+
#user-navigation {
|
69
|
+
top: auto;
|
70
|
+
bottom: 5px;
|
71
|
+
right: 25px;
|
72
|
+
}
|
73
|
+
|
74
|
+
#user-navigation a.logout {
|
75
|
+
background: #ccc;
|
76
|
+
padding: 1px 4px;
|
77
|
+
}
|
78
|
+
|
79
|
+
#main {
|
80
|
+
width: 71%;
|
81
|
+
}
|
82
|
+
|
83
|
+
#main .block {
|
84
|
+
padding-top: 0px;
|
85
|
+
background: #fff;
|
86
|
+
|
87
|
+
-webkit-box-shadow: 0 1px 3px rgba(0, 0, 0, 0.4);
|
88
|
+
-moz-box-shadow: 0 1px 3px rgba(0, 0, 0, 0.4);
|
89
|
+
box-shadow: 0 1px 3px rgba(0, 0, 0, 0.4);
|
90
|
+
}
|
91
|
+
|
92
|
+
#main .block .content {
|
93
|
+
padding-top: 1px;
|
94
|
+
}
|
95
|
+
|
96
|
+
#main .block .content h2 {
|
97
|
+
margin-left: 15px;
|
98
|
+
font-size: 22px;
|
99
|
+
font-style: normal;
|
100
|
+
font-weight: bold;
|
101
|
+
text-transform: none;
|
102
|
+
letter-spacing: -1px;
|
103
|
+
line-height: 1.2em;
|
104
|
+
}
|
105
|
+
|
106
|
+
#main .block .content p {
|
107
|
+
font-size: 13px;
|
108
|
+
font-style: normal;
|
109
|
+
font-weight: normal;
|
110
|
+
text-transform: none;
|
111
|
+
letter-spacing: normal;
|
112
|
+
line-height: 1.45em;
|
113
|
+
}
|
114
|
+
|
115
|
+
#sidebar .block h4 {
|
116
|
+
font-weight: bold;
|
117
|
+
}
|
118
|
+
|
119
|
+
#sidebar .notice {
|
120
|
+
background: #fff;
|
121
|
+
-webkit-box-shadow: 0 1px 3px rgba(0, 0, 0, 0.4);
|
122
|
+
-moz-box-shadow: 0 1px 3px rgba(0, 0, 0, 0.4);
|
123
|
+
box-shadow: 0 1px 3px rgba(0, 0, 0, 0.4);
|
124
|
+
}
|
125
|
+
|
126
|
+
#sidebar h3 {
|
127
|
+
color: #111;
|
128
|
+
border-bottom: 1px solid #c0c0c0;
|
129
|
+
}
|
130
|
+
|
131
|
+
#main-navigation ul li {
|
132
|
+
padding-left: 15px;
|
133
|
+
}
|
134
|
+
|
135
|
+
#main-navigation ul li a {
|
136
|
+
padding: 8px 0;
|
137
|
+
}
|
138
|
+
|
139
|
+
#main-navigation ul li.active {
|
140
|
+
padding: 0;
|
141
|
+
margin-left: 15px;
|
142
|
+
}
|
143
|
+
|
144
|
+
#main-navigation ul li.active {
|
145
|
+
margin-left: 15px;
|
146
|
+
}
|
147
|
+
|
148
|
+
#main-navigation ul li.active a {
|
149
|
+
padding: 8px 15px;
|
150
|
+
}
|
151
|
+
|
152
|
+
#sidebar ul li {
|
153
|
+
background-position: 15px 11px;
|
154
|
+
background-repeat: no-repeat;
|
155
|
+
background-image: url("/images/arrow.png");
|
156
|
+
border-bottom: 1px solid #e2e2e2;
|
157
|
+
}
|
158
|
+
|
159
|
+
#sidebar ul li a {
|
160
|
+
text-decoration: none;
|
161
|
+
margin-left: 20px;
|
162
|
+
}
|
163
|
+
|
164
|
+
#sidebar ul li a:link, #sidebar ul li a:visited {
|
165
|
+
text-decoration: none;
|
166
|
+
}
|
167
|
+
|
168
|
+
#main-navigation {
|
169
|
+
background-color: #f4f4f4;
|
170
|
+
background-image: url("/images/menubar-background.png");
|
171
|
+
background-repeat: repeat-x;
|
172
|
+
}
|
173
|
+
|
174
|
+
#main-navigation ul li {
|
175
|
+
margin-right: 0;
|
176
|
+
padding-left: 15px;
|
177
|
+
padding-right: 5px;
|
178
|
+
}
|
179
|
+
|
180
|
+
#main-navigation ul li a:link, #main-navigation ul li a:visited, #main-navigation ul li a:hover, #main-navigation ul li a:active {
|
181
|
+
text-decoration: none;
|
182
|
+
color: #111;
|
183
|
+
padding: 8px 0;
|
184
|
+
}
|
185
|
+
|
186
|
+
.secondary-navigation ul li a:link, .secondary-navigation ul li a:visited, .secondary-navigation ul li a:hover, .secondary-navigation ul li a:active,
|
187
|
+
#user-navigation ul li a:link, #user-navigation ul li a:visited, #user-navigation ul li a:hover, #user-navigation ul li a:active {
|
188
|
+
text-decoration: none;
|
189
|
+
color: #111;
|
190
|
+
}
|
191
|
+
|
192
|
+
#main-navigation ul li.active a:link, #main-navigation ul li.active a:visited, #main-navigation ul li.active a:hover, #main-navigation ul li.active a:active {
|
193
|
+
color: #a4a4a4;
|
194
|
+
}
|
195
|
+
|
196
|
+
.secondary-navigation {
|
197
|
+
background-color: #f2f1ee;
|
198
|
+
border-bottom: none;
|
199
|
+
border-bottom-width: 5px;
|
200
|
+
background-image: url("/images/boxbar-background.png");
|
201
|
+
}
|
202
|
+
|
203
|
+
.secondary-navigation ul li.active, .secondary-navigation ul li.active a:hover {
|
204
|
+
background-color: #fff;
|
205
|
+
}
|
206
|
+
|
207
|
+
#footer .block {
|
208
|
+
text-align: center;
|
209
|
+
color: #bbbbb7;
|
210
|
+
background: #f4f4f4;
|
211
|
+
|
212
|
+
-webkit-box-shadow: none;
|
213
|
+
-moz-box-shadow: none;
|
214
|
+
box-shadow: none;
|
215
|
+
}
|
216
|
+
|
217
|
+
#footer .block p {
|
218
|
+
margin: 0;
|
219
|
+
padding: 0;
|
220
|
+
}
|
221
|
+
|
222
|
+
/* pagination */
|
223
|
+
|
224
|
+
.pagination a, .pagination span {
|
225
|
+
background-color: #f4f4f4;
|
226
|
+
background-image: url("/images/button-background.png");
|
227
|
+
color: #111;
|
228
|
+
text-align: center;
|
229
|
+
min-width: 15px;
|
230
|
+
margin-right: 5px;
|
231
|
+
padding: 6px;
|
232
|
+
border: 1px solid #c3c4ba;
|
233
|
+
}
|
234
|
+
|
235
|
+
.pagination span.current {
|
236
|
+
background: #261f1f;
|
237
|
+
color: #fff;
|
238
|
+
border: 1px solid #261f1f;
|
239
|
+
}
|
240
|
+
|
241
|
+
.pagination a {
|
242
|
+
color: #1a1a1a;
|
243
|
+
}
|
244
|
+
|
245
|
+
.pagination a:hover {
|
246
|
+
border: 1px solid #818171;
|
247
|
+
-webkit-box-shadow: 0 0 4px rgba(0, 0, 0, 0.3);
|
248
|
+
-moz-box-shadow: 0 0 4px rgba(0, 0, 0, 0.3);
|
249
|
+
box-shadow: 0 0 4px rgba(0, 0, 0, 0.3);
|
250
|
+
}
|
251
|
+
|
252
|
+
.pagination a:active {
|
253
|
+
background-image: url("/images/button-background-active.png");
|
254
|
+
outline: none;
|
255
|
+
}
|
256
|
+
|
257
|
+
/* tables */
|
258
|
+
|
259
|
+
.table th {
|
260
|
+
background: #eaeaea;
|
261
|
+
color: #222;
|
262
|
+
font-weight: normal;
|
263
|
+
}
|
264
|
+
|
265
|
+
.table td {
|
266
|
+
border-bottom: 1px solid #eaeaea;
|
267
|
+
}
|
268
|
+
|
269
|
+
.table tr.even {
|
270
|
+
background: #f8f8f8;
|
271
|
+
}
|
272
|
+
|
273
|
+
/* forms */
|
274
|
+
|
275
|
+
.form label.label {
|
276
|
+
color: #666666;
|
277
|
+
}
|
278
|
+
|
279
|
+
.form input.text_field, .form textarea.text_area {
|
280
|
+
width: 100%;
|
281
|
+
border: 1px solid #e2e2e2;
|
282
|
+
}
|
283
|
+
|
284
|
+
.form input:hover, .form textarea:hover {
|
285
|
+
-webkit-box-shadow: rgba(0,0,0,0.3) 0 0 3px;
|
286
|
+
-moz-box-shadow: rgba(0,0,0,0.3) 0 0 3px;
|
287
|
+
box-shadow: 0 0 3px rgba(0, 0, 0, 0.3);
|
288
|
+
border: 1px solid #a2a294;
|
289
|
+
}
|
290
|
+
|
291
|
+
.form input:focus, .form textarea:focus {
|
292
|
+
border: 1px solid #a2a294;
|
293
|
+
}
|
294
|
+
|
295
|
+
.form input.button {
|
296
|
+
background: #e2e2e2;
|
297
|
+
border: 1px solid #c1c1c1;
|
298
|
+
padding: 2px 5px;
|
299
|
+
cursor: pointer;
|
300
|
+
color: #111;
|
301
|
+
font-weight: bold;
|
302
|
+
font-size: 11px;
|
303
|
+
}
|
304
|
+
|
305
|
+
.form input.button:hover {
|
306
|
+
border: 1px solid #666;
|
307
|
+
}
|
308
|
+
|
309
|
+
.form .description {
|
310
|
+
font-style: italic;
|
311
|
+
color: #8C8C8C;
|
312
|
+
font-size: .9em;
|
313
|
+
}
|
314
|
+
|
315
|
+
.form .navform a {
|
316
|
+
color: #cc0000;
|
317
|
+
}
|
318
|
+
|
319
|
+
/* buttons */
|
320
|
+
|
321
|
+
a.button, button.button {
|
322
|
+
background-color: #f4f4f4;
|
323
|
+
background-image: url("/images/button-background.png");
|
324
|
+
border: 1px solid #c3c4ba;
|
325
|
+
font-family: helvetica, arial, sans-serif;
|
326
|
+
font-weight: normal;
|
327
|
+
}
|
328
|
+
|
329
|
+
a.button:link, a.button:visited, a.button:hover, a.button:active, button.button:link, button.button:visited, button.button:hover, button.button:active {
|
330
|
+
font-weight: normal;
|
331
|
+
background-color: #f4f4f4;
|
332
|
+
}
|
333
|
+
|
334
|
+
a.button:hover, button.button:hover {
|
335
|
+
background-color: #eee;
|
336
|
+
border: 1px solid #818171;
|
337
|
+
-webkit-box-shadow: 0 0 4px rgba(0, 0, 0, 0.3);
|
338
|
+
-moz-box-shadow: 0 0 4px rgba(0, 0, 0, 0.3);
|
339
|
+
box-shadow: 0 0 4px rgba(0, 0, 0, 0.3);
|
340
|
+
}
|
341
|
+
|
342
|
+
a.button:active, button.button:active {
|
343
|
+
outline: none;
|
344
|
+
background-color: #ddd;
|
345
|
+
background-image: url("/images/button-background-active.png");
|
346
|
+
}
|
347
|
+
|
348
|
+
/* flash-messages */
|
349
|
+
.flash .message {
|
350
|
+
text-align:center;
|
351
|
+
margin: 0 auto 15px;
|
352
|
+
}
|
353
|
+
|
354
|
+
.flash .message p {
|
355
|
+
margin:8px;
|
356
|
+
}
|
357
|
+
.flash .error {
|
358
|
+
border: 1px solid #ffbbbb;
|
359
|
+
background-color: #ffdddd;
|
360
|
+
}
|
361
|
+
.flash .warning {
|
362
|
+
border: 1px solid #ffff88;
|
363
|
+
background-color: #ffffcc;
|
364
|
+
}
|
365
|
+
.flash .notice {
|
366
|
+
border: 1px solid #1fdf00;
|
367
|
+
background-color: #bbffb6;
|
368
|
+
}
|
369
|
+
|
370
|
+
/* lists */
|
371
|
+
|
372
|
+
ul.list li {
|
373
|
+
border-bottom-color: #e2e2e2;
|
374
|
+
border-bottom-width: 1px;
|
375
|
+
border-bottom-style: solid;
|
376
|
+
}
|
377
|
+
|
378
|
+
ul.list li .item .avatar {
|
379
|
+
border-color: #e2e2e2;
|
380
|
+
border-width: 1px;
|
381
|
+
border-style: solid;
|
382
|
+
padding: 2px;
|
383
|
+
}
|
384
|
+
|
385
|
+
/* box */
|
386
|
+
|
387
|
+
#box .block {
|
388
|
+
background: #fff;
|
389
|
+
|
390
|
+
-webkit-box-shadow: 0 1px 3px rgba(0, 0, 0, 0.4);
|
391
|
+
-moz-box-shadow: 0 1px 3px rgba(0, 0, 0, 0.4);
|
392
|
+
box-shadow: 0 1px 3px rgba(0, 0, 0, 0.4);
|
393
|
+
}
|
394
|
+
|
395
|
+
#box .block h2 {
|
396
|
+
background: #261f1f;
|
397
|
+
color: #fff;
|
398
|
+
}
|
399
|
+
|
400
|
+
|
401
|
+
/* rounded borders */
|
402
|
+
|
403
|
+
#main, #main-navigation, #main-navigation li, .secondary-navigation, #main .block, #sidebar .block, #sidebar h3, ul.list li,
|
404
|
+
#footer .block, .form input.button, #box .block, #box .block h2 {
|
405
|
+
-moz-border-radius-topleft: 9px;
|
406
|
+
-webkit-border-top-left-radius: 9px;
|
407
|
+
-moz-border-radius-topright: 9px;
|
408
|
+
-webkit-border-top-right-radius: 9px;
|
409
|
+
}
|
410
|
+
|
411
|
+
.secondary-navigation li.first a, .secondary-navigation ul li.first {
|
412
|
+
-moz-border-radius-topleft: 9px;
|
413
|
+
-webkit-border-top-left-radius: 9px;
|
414
|
+
}
|
415
|
+
|
416
|
+
.secondary-navigation ul li.first {
|
417
|
+
-moz-border-radius-topleft: 9px;
|
418
|
+
-webkit-border-top-left-radius: 9px;
|
419
|
+
}
|
420
|
+
|
421
|
+
#sidebar, #sidebar .block, #main .block, #sidebar ul.navigation, ul.list li, #footer .block, .form input.button, #box .block {
|
422
|
+
-moz-border-radius-bottomleft: 9px;
|
423
|
+
-webkit-border-bottom-left-radius: 9px;
|
424
|
+
-moz-border-radius-bottomright: 9px;
|
425
|
+
-webkit-border-bottom-right-radius: 9px;
|
426
|
+
}
|
427
|
+
|
428
|
+
#main .block {
|
429
|
+
-moz-border-radius: 9px;
|
430
|
+
-webkit-border-radius: 9px;
|
431
|
+
border-radius: 9px;
|
432
|
+
}
|
433
|
+
|
434
|
+
#main-navigation, .secondary-navigation {
|
435
|
+
-moz-border-radius-topleft: 9px;
|
436
|
+
-webkit-border-top-left-radius: 9px;
|
437
|
+
border-top-left-radius: 9px;
|
438
|
+
|
439
|
+
-moz-border-radius-topright: 9px;
|
440
|
+
-webkit-border-top-right-radius: 9px;
|
441
|
+
border-top-right-radius: 9px;
|
442
|
+
}
|
443
|
+
|
444
|
+
a.button, button.button, .pagination a, .pagination span {
|
445
|
+
-moz-border-radius: 2px;
|
446
|
+
-webkit-border-radius: 2px;
|
447
|
+
border-radius: 2px;
|
448
|
+
}
|
449
|
+
|
450
|
+
.flash .message {
|
451
|
+
-moz-border-radius: 6px;
|
452
|
+
-webkit-border-radius: 6px;
|
453
|
+
border-radius: 6px;
|
454
|
+
}
|
455
|
+
|
456
|
+
.form input.button {
|
457
|
+
-moz-border-radius: 5px;
|
458
|
+
-webkit-border-radius: 5px;
|
459
|
+
border-radius: 5px;
|
460
|
+
}
|
461
|
+
|
462
|
+
#user-navigation a.logout {
|
463
|
+
-moz-border-radius: 4px;
|
464
|
+
-webkit-border-radius: 4px;
|
465
|
+
border-radius: 4px;
|
466
|
+
}
|
@@ -0,0 +1,125 @@
|
|
1
|
+
require 'spec_helper'
|
2
|
+
|
3
|
+
describe UsersController do
|
4
|
+
|
5
|
+
def mock_user(stubs={})
|
6
|
+
@mock_user ||= mock_model(User, stubs).as_null_object
|
7
|
+
end
|
8
|
+
|
9
|
+
describe "GET index" do
|
10
|
+
it "assigns all users as @users" do
|
11
|
+
User.stub(:all) { [mock_user] }
|
12
|
+
get :index
|
13
|
+
assigns(:users).should eq([mock_user])
|
14
|
+
end
|
15
|
+
end
|
16
|
+
|
17
|
+
describe "GET show" do
|
18
|
+
it "assigns the requested user as @user" do
|
19
|
+
User.stub(:find).with("37") { mock_user }
|
20
|
+
get :show, :id => "37"
|
21
|
+
assigns(:user).should be(mock_user)
|
22
|
+
end
|
23
|
+
end
|
24
|
+
|
25
|
+
describe "GET new" do
|
26
|
+
it "assigns a new user as @user" do
|
27
|
+
User.stub(:new) { mock_user }
|
28
|
+
get :new
|
29
|
+
assigns(:user).should be(mock_user)
|
30
|
+
end
|
31
|
+
end
|
32
|
+
|
33
|
+
describe "GET edit" do
|
34
|
+
it "assigns the requested user as @user" do
|
35
|
+
User.stub(:find).with("37") { mock_user }
|
36
|
+
get :edit, :id => "37"
|
37
|
+
assigns(:user).should be(mock_user)
|
38
|
+
end
|
39
|
+
end
|
40
|
+
|
41
|
+
describe "POST create" do
|
42
|
+
|
43
|
+
describe "with valid params" do
|
44
|
+
it "assigns a newly created user as @user" do
|
45
|
+
User.stub(:new).with({'these' => 'params'}) { mock_user(:save => true) }
|
46
|
+
post :create, :user => {'these' => 'params'}
|
47
|
+
assigns(:user).should be(mock_user)
|
48
|
+
end
|
49
|
+
|
50
|
+
it "redirects to the created user" do
|
51
|
+
User.stub(:new) { mock_user(:save => true) }
|
52
|
+
post :create, :user => {}
|
53
|
+
response.should redirect_to(user_url(mock_user))
|
54
|
+
end
|
55
|
+
end
|
56
|
+
|
57
|
+
describe "with invalid params" do
|
58
|
+
it "assigns a newly created but unsaved user as @user" do
|
59
|
+
User.stub(:new).with({'these' => 'params'}) { mock_user(:save => false) }
|
60
|
+
post :create, :user => {'these' => 'params'}
|
61
|
+
assigns(:user).should be(mock_user)
|
62
|
+
end
|
63
|
+
|
64
|
+
it "re-renders the 'new' template" do
|
65
|
+
User.stub(:new) { mock_user(:save => false) }
|
66
|
+
post :create, :user => {}
|
67
|
+
response.should render_template("new")
|
68
|
+
end
|
69
|
+
end
|
70
|
+
|
71
|
+
end
|
72
|
+
|
73
|
+
describe "PUT update" do
|
74
|
+
|
75
|
+
describe "with valid params" do
|
76
|
+
it "updates the requested user" do
|
77
|
+
User.should_receive(:find).with("37") { mock_user }
|
78
|
+
mock_user.should_receive(:update_attributes).with({'these' => 'params'})
|
79
|
+
put :update, :id => "37", :user => {'these' => 'params'}
|
80
|
+
end
|
81
|
+
|
82
|
+
it "assigns the requested user as @user" do
|
83
|
+
User.stub(:find) { mock_user(:update_attributes => true) }
|
84
|
+
put :update, :id => "1"
|
85
|
+
assigns(:user).should be(mock_user)
|
86
|
+
end
|
87
|
+
|
88
|
+
it "redirects to the user" do
|
89
|
+
User.stub(:find) { mock_user(:update_attributes => true) }
|
90
|
+
put :update, :id => "1"
|
91
|
+
response.should redirect_to(user_url(mock_user))
|
92
|
+
end
|
93
|
+
end
|
94
|
+
|
95
|
+
describe "with invalid params" do
|
96
|
+
it "assigns the user as @user" do
|
97
|
+
User.stub(:find) { mock_user(:update_attributes => false) }
|
98
|
+
put :update, :id => "1"
|
99
|
+
assigns(:user).should be(mock_user)
|
100
|
+
end
|
101
|
+
|
102
|
+
it "re-renders the 'edit' template" do
|
103
|
+
User.stub(:find) { mock_user(:update_attributes => false) }
|
104
|
+
put :update, :id => "1"
|
105
|
+
response.should render_template("edit")
|
106
|
+
end
|
107
|
+
end
|
108
|
+
|
109
|
+
end
|
110
|
+
|
111
|
+
describe "DELETE destroy" do
|
112
|
+
it "destroys the requested user" do
|
113
|
+
User.should_receive(:find).with("37") { mock_user }
|
114
|
+
mock_user.should_receive(:destroy)
|
115
|
+
delete :destroy, :id => "37"
|
116
|
+
end
|
117
|
+
|
118
|
+
it "redirects to the users list" do
|
119
|
+
User.stub(:find) { mock_user }
|
120
|
+
delete :destroy, :id => "1"
|
121
|
+
response.should redirect_to(users_url)
|
122
|
+
end
|
123
|
+
end
|
124
|
+
|
125
|
+
end
|
@@ -0,0 +1,15 @@
|
|
1
|
+
require 'spec_helper'
|
2
|
+
|
3
|
+
# Specs in this file have access to a helper object that includes
|
4
|
+
# the UsersHelper. For example:
|
5
|
+
#
|
6
|
+
# describe UsersHelper do
|
7
|
+
# describe "string concat" do
|
8
|
+
# it "concats two strings with spaces" do
|
9
|
+
# helper.concat_strings("this","that").should == "this that"
|
10
|
+
# end
|
11
|
+
# end
|
12
|
+
# end
|
13
|
+
describe UsersHelper do
|
14
|
+
pending "add some examples to (or delete) #{__FILE__}"
|
15
|
+
end
|
@@ -0,0 +1,35 @@
|
|
1
|
+
require "spec_helper"
|
2
|
+
|
3
|
+
describe UsersController do
|
4
|
+
describe "routing" do
|
5
|
+
|
6
|
+
it "recognizes and generates #index" do
|
7
|
+
{ :get => "/users" }.should route_to(:controller => "users", :action => "index")
|
8
|
+
end
|
9
|
+
|
10
|
+
it "recognizes and generates #new" do
|
11
|
+
{ :get => "/users/new" }.should route_to(:controller => "users", :action => "new")
|
12
|
+
end
|
13
|
+
|
14
|
+
it "recognizes and generates #show" do
|
15
|
+
{ :get => "/users/1" }.should route_to(:controller => "users", :action => "show", :id => "1")
|
16
|
+
end
|
17
|
+
|
18
|
+
it "recognizes and generates #edit" do
|
19
|
+
{ :get => "/users/1/edit" }.should route_to(:controller => "users", :action => "edit", :id => "1")
|
20
|
+
end
|
21
|
+
|
22
|
+
it "recognizes and generates #create" do
|
23
|
+
{ :post => "/users" }.should route_to(:controller => "users", :action => "create")
|
24
|
+
end
|
25
|
+
|
26
|
+
it "recognizes and generates #update" do
|
27
|
+
{ :put => "/users/1" }.should route_to(:controller => "users", :action => "update", :id => "1")
|
28
|
+
end
|
29
|
+
|
30
|
+
it "recognizes and generates #destroy" do
|
31
|
+
{ :delete => "/users/1" }.should route_to(:controller => "users", :action => "destroy", :id => "1")
|
32
|
+
end
|
33
|
+
|
34
|
+
end
|
35
|
+
end
|
@@ -0,0 +1,16 @@
|
|
1
|
+
# This file is copied to spec/ when you run 'rails generate rspec:install'
|
2
|
+
ENV["RAILS_ENV"] ||= 'test'
|
3
|
+
require File.expand_path("../../config/environment", __FILE__)
|
4
|
+
require 'rspec/rails'
|
5
|
+
require 'webmock/rspec'
|
6
|
+
|
7
|
+
# Requires supporting ruby files with custom matchers and macros, etc,
|
8
|
+
# in spec/support/ and its subdirectories.
|
9
|
+
Dir[Rails.root.join("spec/support/**/*.rb")].each {|f| require f}
|
10
|
+
|
11
|
+
RSpec.configure do |config|
|
12
|
+
config.mock_with :rspec
|
13
|
+
config.fixture_path = "#{::Rails.root}/spec/fixtures"
|
14
|
+
config.use_transactional_fixtures = true
|
15
|
+
config.include WebMock
|
16
|
+
end
|
@@ -0,0 +1,27 @@
|
|
1
|
+
require 'spec_helper'
|
2
|
+
|
3
|
+
describe "users/edit.html.erb" do
|
4
|
+
before(:each) do
|
5
|
+
@user = assign(:user, stub_model(User,
|
6
|
+
:new_record? => false,
|
7
|
+
:name => "MyString",
|
8
|
+
:nickname => "MyString",
|
9
|
+
:image => "MyString",
|
10
|
+
:description => "MyString",
|
11
|
+
:location => "MyString"
|
12
|
+
))
|
13
|
+
end
|
14
|
+
|
15
|
+
it "renders the edit user form" do
|
16
|
+
render
|
17
|
+
|
18
|
+
# Run the generator again with the --webrat-matchers flag if you want to use webrat matchers
|
19
|
+
assert_select "form", :action => user_path(@user), :method => "post" do
|
20
|
+
assert_select "input#user_name", :name => "user[name]"
|
21
|
+
assert_select "input#user_nickname", :name => "user[nickname]"
|
22
|
+
assert_select "input#user_image", :name => "user[image]"
|
23
|
+
assert_select "input#user_description", :name => "user[description]"
|
24
|
+
assert_select "input#user_location", :name => "user[location]"
|
25
|
+
end
|
26
|
+
end
|
27
|
+
end
|