upjs-rails 0.1.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/.gitignore +17 -0
- data/.ruby-version +2 -0
- data/LICENSE.txt +22 -0
- data/README.md +47 -0
- data/Rakefile +1 -0
- data/bin/doc-server +3 -0
- data/bin/install-ydoc +4 -0
- data/design/animation-ghosting.txt +72 -0
- data/design/design.txt +34 -0
- data/design/draft.html.erb +48 -0
- data/design/draft.rb +9 -0
- data/lib/assets/javascripts/up/browser.js.coffee +20 -0
- data/lib/assets/javascripts/up/bus.js.coffee +54 -0
- data/lib/assets/javascripts/up/flow.js.coffee +160 -0
- data/lib/assets/javascripts/up/form.js.coffee +162 -0
- data/lib/assets/javascripts/up/history.js.coffee +33 -0
- data/lib/assets/javascripts/up/index.js +13 -0
- data/lib/assets/javascripts/up/link.js.coffee +95 -0
- data/lib/assets/javascripts/up/magic.js.coffee +79 -0
- data/lib/assets/javascripts/up/modal.js.coffee +51 -0
- data/lib/assets/javascripts/up/module.js.coffee +4 -0
- data/lib/assets/javascripts/up/motion.js.coffee +276 -0
- data/lib/assets/javascripts/up/navigation.js.coffee +63 -0
- data/lib/assets/javascripts/up/popup.js.coffee +143 -0
- data/lib/assets/javascripts/up/util.js.coffee +287 -0
- data/lib/assets/stylesheets/up/follow.css.sass +2 -0
- data/lib/assets/stylesheets/up/index.css +3 -0
- data/lib/assets/stylesheets/up/modal.css.sass +54 -0
- data/lib/assets/stylesheets/up/popup.css.sass +9 -0
- data/lib/upjs/rails/engine.rb +6 -0
- data/lib/upjs/rails/redirection.rb +26 -0
- data/lib/upjs/rails/request.rb +13 -0
- data/lib/upjs/rails/version.rb +5 -0
- data/lib/upjs-rails.rb +7 -0
- data/spec_app/.firefox-version +1 -0
- data/spec_app/.gitignore +17 -0
- data/spec_app/Gemfile +24 -0
- data/spec_app/Gemfile.lock +239 -0
- data/spec_app/README.rdoc +28 -0
- data/spec_app/Rakefile +6 -0
- data/spec_app/app/assets/images/.keep +0 -0
- data/spec_app/app/assets/javascripts/application.js +16 -0
- data/spec_app/app/assets/stylesheets/application.css +15 -0
- data/spec_app/app/assets/stylesheets/blocks/card.css.sass +11 -0
- data/spec_app/app/assets/stylesheets/blocks/controls.css.sass +7 -0
- data/spec_app/app/assets/stylesheets/blocks/field_with_errors.css.sass +5 -0
- data/spec_app/app/assets/stylesheets/blocks/menu.css.sass +13 -0
- data/spec_app/app/assets/stylesheets/blocks/panel.css.sass +8 -0
- data/spec_app/app/controllers/application_controller.rb +14 -0
- data/spec_app/app/controllers/cards_controller.rb +51 -0
- data/spec_app/app/controllers/concerns/.keep +0 -0
- data/spec_app/app/controllers/pages_controller.rb +6 -0
- data/spec_app/app/helpers/application_helper.rb +2 -0
- data/spec_app/app/mailers/.keep +0 -0
- data/spec_app/app/models/card.rb +6 -0
- data/spec_app/app/models/concerns/.keep +0 -0
- data/spec_app/app/models/tests.rb +27 -0
- data/spec_app/app/views/cards/_side.html.haml +4 -0
- data/spec_app/app/views/cards/index.html.haml +10 -0
- data/spec_app/app/views/cards/new.html.haml +15 -0
- data/spec_app/app/views/cards/show.html.haml +11 -0
- data/spec_app/app/views/layouts/application.html.erb +12 -0
- data/spec_app/app/views/pages/home.html.haml +5 -0
- data/spec_app/bin/bundle +3 -0
- data/spec_app/bin/rails +8 -0
- data/spec_app/bin/rake +8 -0
- data/spec_app/bin/setup +29 -0
- data/spec_app/bin/spring +18 -0
- data/spec_app/config/application.rb +26 -0
- data/spec_app/config/boot.rb +3 -0
- data/spec_app/config/cucumber.yml +8 -0
- data/spec_app/config/database.yml +25 -0
- data/spec_app/config/environment.rb +5 -0
- data/spec_app/config/environments/development.rb +41 -0
- data/spec_app/config/environments/production.rb +79 -0
- data/spec_app/config/environments/test.rb +42 -0
- data/spec_app/config/initializers/assets.rb +11 -0
- data/spec_app/config/initializers/backtrace_silencers.rb +7 -0
- data/spec_app/config/initializers/cookies_serializer.rb +3 -0
- data/spec_app/config/initializers/filter_parameter_logging.rb +4 -0
- data/spec_app/config/initializers/inflections.rb +16 -0
- data/spec_app/config/initializers/mime_types.rb +4 -0
- data/spec_app/config/initializers/session_store.rb +3 -0
- data/spec_app/config/initializers/wrap_parameters.rb +14 -0
- data/spec_app/config/locales/en.yml +23 -0
- data/spec_app/config/routes.rb +6 -0
- data/spec_app/config/secrets.yml +22 -0
- data/spec_app/config.ru +4 -0
- data/spec_app/db/migrate/20141225125143_create_card.rb +9 -0
- data/spec_app/db/schema.rb +23 -0
- data/spec_app/db/seeds.rb +7 -0
- data/spec_app/features/history.feature +30 -0
- data/spec_app/features/navigation.feature +9 -0
- data/spec_app/features/step_definitions/factory_steps.rb +5 -0
- data/spec_app/features/step_definitions/navigation_steps.rb +29 -0
- data/spec_app/features/step_definitions/utility_steps.rb +15 -0
- data/spec_app/features/support/env.rb +73 -0
- data/spec_app/features/support/find_by_anything.rb +19 -0
- data/spec_app/features/support/paths.rb +51 -0
- data/spec_app/lib/assets/.keep +0 -0
- data/spec_app/lib/tasks/.keep +0 -0
- data/spec_app/lib/tasks/cucumber.rake +65 -0
- data/spec_app/log/.keep +0 -0
- data/spec_app/public/404.html +67 -0
- data/spec_app/public/422.html +67 -0
- data/spec_app/public/500.html +66 -0
- data/spec_app/public/favicon.ico +0 -0
- data/spec_app/public/robots.txt +5 -0
- data/spec_app/script/cucumber +10 -0
- data/spec_app/test/controllers/.keep +0 -0
- data/spec_app/test/fixtures/.keep +0 -0
- data/spec_app/test/helpers/.keep +0 -0
- data/spec_app/test/integration/.keep +0 -0
- data/spec_app/test/mailers/.keep +0 -0
- data/spec_app/test/models/.keep +0 -0
- data/spec_app/test/test_helper.rb +10 -0
- data/spec_app/vendor/assets/javascripts/.keep +0 -0
- data/spec_app/vendor/assets/stylesheets/.keep +0 -0
- data/upjs-rails.gemspec +24 -0
- metadata +207 -0
@@ -0,0 +1,239 @@
|
|
1
|
+
PATH
|
2
|
+
remote: ..
|
3
|
+
specs:
|
4
|
+
upjs-rails (0.0.1)
|
5
|
+
rails (>= 3)
|
6
|
+
|
7
|
+
GEM
|
8
|
+
remote: https://rubygems.org/
|
9
|
+
specs:
|
10
|
+
actionmailer (4.2.0)
|
11
|
+
actionpack (= 4.2.0)
|
12
|
+
actionview (= 4.2.0)
|
13
|
+
activejob (= 4.2.0)
|
14
|
+
mail (~> 2.5, >= 2.5.4)
|
15
|
+
rails-dom-testing (~> 1.0, >= 1.0.5)
|
16
|
+
actionpack (4.2.0)
|
17
|
+
actionview (= 4.2.0)
|
18
|
+
activesupport (= 4.2.0)
|
19
|
+
rack (~> 1.6.0)
|
20
|
+
rack-test (~> 0.6.2)
|
21
|
+
rails-dom-testing (~> 1.0, >= 1.0.5)
|
22
|
+
rails-html-sanitizer (~> 1.0, >= 1.0.1)
|
23
|
+
actionview (4.2.0)
|
24
|
+
activesupport (= 4.2.0)
|
25
|
+
builder (~> 3.1)
|
26
|
+
erubis (~> 2.7.0)
|
27
|
+
rails-dom-testing (~> 1.0, >= 1.0.5)
|
28
|
+
rails-html-sanitizer (~> 1.0, >= 1.0.1)
|
29
|
+
activejob (4.2.0)
|
30
|
+
activesupport (= 4.2.0)
|
31
|
+
globalid (>= 0.3.0)
|
32
|
+
activemodel (4.2.0)
|
33
|
+
activesupport (= 4.2.0)
|
34
|
+
builder (~> 3.1)
|
35
|
+
activerecord (4.2.0)
|
36
|
+
activemodel (= 4.2.0)
|
37
|
+
activesupport (= 4.2.0)
|
38
|
+
arel (~> 6.0)
|
39
|
+
activesupport (4.2.0)
|
40
|
+
i18n (~> 0.7)
|
41
|
+
json (~> 1.7, >= 1.7.7)
|
42
|
+
minitest (~> 5.1)
|
43
|
+
thread_safe (~> 0.3, >= 0.3.4)
|
44
|
+
tzinfo (~> 1.1)
|
45
|
+
arel (6.0.0)
|
46
|
+
binding_of_caller (0.7.2)
|
47
|
+
debug_inspector (>= 0.0.1)
|
48
|
+
builder (3.2.2)
|
49
|
+
byebug (3.5.1)
|
50
|
+
columnize (~> 0.8)
|
51
|
+
debugger-linecache (~> 1.2)
|
52
|
+
slop (~> 3.6)
|
53
|
+
capybara (2.4.1)
|
54
|
+
mime-types (>= 1.16)
|
55
|
+
nokogiri (>= 1.3.3)
|
56
|
+
rack (>= 1.0.0)
|
57
|
+
rack-test (>= 0.5.4)
|
58
|
+
xpath (~> 2.0)
|
59
|
+
childprocess (0.5.3)
|
60
|
+
ffi (~> 1.0, >= 1.0.11)
|
61
|
+
coffee-rails (4.1.0)
|
62
|
+
coffee-script (>= 2.2.0)
|
63
|
+
railties (>= 4.0.0, < 5.0)
|
64
|
+
coffee-script (2.3.0)
|
65
|
+
coffee-script-source
|
66
|
+
execjs
|
67
|
+
coffee-script-source (1.8.0)
|
68
|
+
columnize (0.9.0)
|
69
|
+
cucumber (1.3.16)
|
70
|
+
builder (>= 2.1.2)
|
71
|
+
diff-lcs (>= 1.1.3)
|
72
|
+
gherkin (~> 2.12)
|
73
|
+
multi_json (>= 1.7.5, < 2.0)
|
74
|
+
multi_test (>= 0.1.1)
|
75
|
+
cucumber-rails (1.4.0)
|
76
|
+
capybara (>= 1.1.2)
|
77
|
+
cucumber (>= 1.2.0)
|
78
|
+
nokogiri (>= 1.5.0)
|
79
|
+
rails (>= 3.0.0)
|
80
|
+
database_cleaner (1.3.0)
|
81
|
+
debug_inspector (0.0.2)
|
82
|
+
debugger-linecache (1.2.0)
|
83
|
+
diff-lcs (1.2.5)
|
84
|
+
erubis (2.7.0)
|
85
|
+
execjs (2.2.2)
|
86
|
+
ffi (1.9.5)
|
87
|
+
gherkin (2.12.2)
|
88
|
+
multi_json (~> 1.3)
|
89
|
+
globalid (0.3.0)
|
90
|
+
activesupport (>= 4.1.0)
|
91
|
+
haml (4.1.0.beta.1)
|
92
|
+
tilt
|
93
|
+
haml-rails (0.6.0)
|
94
|
+
actionpack (>= 4.0.1)
|
95
|
+
activesupport (>= 4.0.1)
|
96
|
+
haml (>= 3.1, < 5.0)
|
97
|
+
html2haml (>= 1.0.1)
|
98
|
+
railties (>= 4.0.1)
|
99
|
+
hike (1.2.3)
|
100
|
+
hpricot (0.8.6)
|
101
|
+
html2haml (1.0.1)
|
102
|
+
erubis (~> 2.7.0)
|
103
|
+
haml (>= 4.0.0.rc.1)
|
104
|
+
hpricot (~> 0.8.6)
|
105
|
+
ruby_parser (~> 3.1.1)
|
106
|
+
i18n (0.7.0)
|
107
|
+
jquery-rails (4.0.2)
|
108
|
+
rails-dom-testing (~> 1.0)
|
109
|
+
railties (>= 4.2.0)
|
110
|
+
thor (>= 0.14, < 2.0)
|
111
|
+
json (1.8.1)
|
112
|
+
libv8 (3.16.14.3)
|
113
|
+
loofah (2.0.1)
|
114
|
+
nokogiri (>= 1.5.9)
|
115
|
+
mail (2.6.3)
|
116
|
+
mime-types (>= 1.16, < 3)
|
117
|
+
mime-types (2.4.3)
|
118
|
+
mini_portile (0.6.1)
|
119
|
+
minitest (5.5.0)
|
120
|
+
multi_json (1.10.1)
|
121
|
+
multi_test (0.1.1)
|
122
|
+
nokogiri (1.6.5)
|
123
|
+
mini_portile (~> 0.6.0)
|
124
|
+
rack (1.6.0)
|
125
|
+
rack-test (0.6.2)
|
126
|
+
rack (>= 1.0)
|
127
|
+
rails (4.2.0)
|
128
|
+
actionmailer (= 4.2.0)
|
129
|
+
actionpack (= 4.2.0)
|
130
|
+
actionview (= 4.2.0)
|
131
|
+
activejob (= 4.2.0)
|
132
|
+
activemodel (= 4.2.0)
|
133
|
+
activerecord (= 4.2.0)
|
134
|
+
activesupport (= 4.2.0)
|
135
|
+
bundler (>= 1.3.0, < 2.0)
|
136
|
+
railties (= 4.2.0)
|
137
|
+
sprockets-rails
|
138
|
+
rails-deprecated_sanitizer (1.0.3)
|
139
|
+
activesupport (>= 4.2.0.alpha)
|
140
|
+
rails-dom-testing (1.0.5)
|
141
|
+
activesupport (>= 4.2.0.beta, < 5.0)
|
142
|
+
nokogiri (~> 1.6.0)
|
143
|
+
rails-deprecated_sanitizer (>= 1.0.1)
|
144
|
+
rails-html-sanitizer (1.0.1)
|
145
|
+
loofah (~> 2.0)
|
146
|
+
railties (4.2.0)
|
147
|
+
actionpack (= 4.2.0)
|
148
|
+
activesupport (= 4.2.0)
|
149
|
+
rake (>= 0.8.7)
|
150
|
+
thor (>= 0.18.1, < 2.0)
|
151
|
+
rake (10.4.2)
|
152
|
+
ref (1.0.5)
|
153
|
+
rspec-core (3.0.4)
|
154
|
+
rspec-support (~> 3.0.0)
|
155
|
+
rspec-expectations (3.0.4)
|
156
|
+
diff-lcs (>= 1.2.0, < 2.0)
|
157
|
+
rspec-support (~> 3.0.0)
|
158
|
+
rspec-mocks (3.0.4)
|
159
|
+
rspec-support (~> 3.0.0)
|
160
|
+
rspec-rails (3.0.2)
|
161
|
+
actionpack (>= 3.0)
|
162
|
+
activesupport (>= 3.0)
|
163
|
+
railties (>= 3.0)
|
164
|
+
rspec-core (~> 3.0.0)
|
165
|
+
rspec-expectations (~> 3.0.0)
|
166
|
+
rspec-mocks (~> 3.0.0)
|
167
|
+
rspec-support (~> 3.0.0)
|
168
|
+
rspec-support (3.0.4)
|
169
|
+
ruby_parser (3.1.3)
|
170
|
+
sexp_processor (~> 4.1)
|
171
|
+
rubyzip (1.1.6)
|
172
|
+
sass (3.4.9)
|
173
|
+
sass-rails (5.0.0)
|
174
|
+
railties (>= 4.0.0, < 5.0)
|
175
|
+
sass (~> 3.1)
|
176
|
+
sprockets (>= 2.8, < 4.0)
|
177
|
+
sprockets-rails (>= 2.0, < 4.0)
|
178
|
+
tilt (~> 1.1)
|
179
|
+
selenium-webdriver (2.42.0)
|
180
|
+
childprocess (>= 0.5.0)
|
181
|
+
multi_json (~> 1.0)
|
182
|
+
rubyzip (~> 1.0)
|
183
|
+
websocket (~> 1.0.4)
|
184
|
+
sexp_processor (4.4.4)
|
185
|
+
slop (3.6.0)
|
186
|
+
spreewald (1.1.1)
|
187
|
+
capybara
|
188
|
+
cucumber
|
189
|
+
cucumber-rails
|
190
|
+
sprockets (2.12.3)
|
191
|
+
hike (~> 1.2)
|
192
|
+
multi_json (~> 1.0)
|
193
|
+
rack (~> 1.0)
|
194
|
+
tilt (~> 1.1, != 1.3.0)
|
195
|
+
sprockets-rails (2.2.2)
|
196
|
+
actionpack (>= 3.0)
|
197
|
+
activesupport (>= 3.0)
|
198
|
+
sprockets (>= 2.8, < 4.0)
|
199
|
+
sqlite3 (1.3.10)
|
200
|
+
therubyracer (0.12.1)
|
201
|
+
libv8 (~> 3.16.14.0)
|
202
|
+
ref
|
203
|
+
thor (0.19.1)
|
204
|
+
thread_safe (0.3.4)
|
205
|
+
tilt (1.4.1)
|
206
|
+
tzinfo (1.2.2)
|
207
|
+
thread_safe (~> 0.1)
|
208
|
+
uglifier (2.6.0)
|
209
|
+
execjs (>= 0.3.0)
|
210
|
+
json (>= 1.8.0)
|
211
|
+
web-console (2.0.0)
|
212
|
+
activemodel (~> 4.0)
|
213
|
+
binding_of_caller (>= 0.7.2)
|
214
|
+
railties (~> 4.0)
|
215
|
+
sprockets-rails (>= 2.0, < 4.0)
|
216
|
+
websocket (1.0.7)
|
217
|
+
xpath (2.0.0)
|
218
|
+
nokogiri (~> 1.3)
|
219
|
+
|
220
|
+
PLATFORMS
|
221
|
+
ruby
|
222
|
+
|
223
|
+
DEPENDENCIES
|
224
|
+
byebug
|
225
|
+
coffee-rails (~> 4.1.0)
|
226
|
+
cucumber-rails
|
227
|
+
database_cleaner
|
228
|
+
haml-rails
|
229
|
+
jquery-rails
|
230
|
+
rails (= 4.2.0)
|
231
|
+
rspec-rails
|
232
|
+
sass-rails (~> 5.0)
|
233
|
+
selenium-webdriver
|
234
|
+
spreewald
|
235
|
+
sqlite3
|
236
|
+
therubyracer
|
237
|
+
uglifier (>= 1.3.0)
|
238
|
+
upjs-rails!
|
239
|
+
web-console (~> 2.0)
|
@@ -0,0 +1,28 @@
|
|
1
|
+
== README
|
2
|
+
|
3
|
+
This README would normally document whatever steps are necessary to get the
|
4
|
+
application up and running.
|
5
|
+
|
6
|
+
Things you may want to cover:
|
7
|
+
|
8
|
+
* Ruby version
|
9
|
+
|
10
|
+
* System dependencies
|
11
|
+
|
12
|
+
* Configuration
|
13
|
+
|
14
|
+
* Database creation
|
15
|
+
|
16
|
+
* Database initialization
|
17
|
+
|
18
|
+
* How to run the test suite
|
19
|
+
|
20
|
+
* Services (job queues, cache servers, search engines, etc.)
|
21
|
+
|
22
|
+
* Deployment instructions
|
23
|
+
|
24
|
+
* ...
|
25
|
+
|
26
|
+
|
27
|
+
Please feel free to use a different markup language if you do not plan to run
|
28
|
+
<tt>rake doc:app</tt>.
|
data/spec_app/Rakefile
ADDED
File without changes
|
@@ -0,0 +1,16 @@
|
|
1
|
+
// This is a manifest file that'll be compiled into application.js, which will include all the files
|
2
|
+
// listed below.
|
3
|
+
//
|
4
|
+
// Any JavaScript/Coffee file within this directory, lib/assets/javascripts, vendor/assets/javascripts,
|
5
|
+
// or any plugin's vendor/assets/javascripts directory can be referenced here using a relative path.
|
6
|
+
//
|
7
|
+
// It's not advisable to add code directly here, but if you do, it'll appear at the bottom of the
|
8
|
+
// compiled file.
|
9
|
+
//
|
10
|
+
// Read Sprockets README (https://github.com/sstephenson/sprockets#sprockets-directives) for details
|
11
|
+
// about supported directives.
|
12
|
+
//
|
13
|
+
//= require jquery
|
14
|
+
//= require jquery_ujs
|
15
|
+
//= require up
|
16
|
+
//= require_tree .
|
@@ -0,0 +1,15 @@
|
|
1
|
+
/*
|
2
|
+
* This is a manifest file that'll be compiled into application.css, which will include all the files
|
3
|
+
* listed below.
|
4
|
+
*
|
5
|
+
* Any CSS and SCSS file within this directory, lib/assets/stylesheets, vendor/assets/stylesheets,
|
6
|
+
* or any plugin's vendor/assets/stylesheets directory can be referenced here using a relative path.
|
7
|
+
*
|
8
|
+
* You're free to add application-wide styles to this file and they'll appear at the bottom of the
|
9
|
+
* compiled file so the styles you add here take precedence over styles defined in any styles
|
10
|
+
* defined in the other CSS/SCSS files in this directory. It is generally better to create a new
|
11
|
+
* file per style scope.
|
12
|
+
*
|
13
|
+
*= require_tree .
|
14
|
+
*= require_self
|
15
|
+
*/
|
@@ -0,0 +1,14 @@
|
|
1
|
+
class ApplicationController < ActionController::Base
|
2
|
+
# Prevent CSRF attacks by raising an exception.
|
3
|
+
# For APIs, you may want to use :null_session instead.
|
4
|
+
protect_from_forgery with: :exception
|
5
|
+
|
6
|
+
before_filter :delay_response
|
7
|
+
|
8
|
+
private
|
9
|
+
|
10
|
+
def delay_response
|
11
|
+
sleep Tests.response_delay
|
12
|
+
end
|
13
|
+
|
14
|
+
end
|
@@ -0,0 +1,51 @@
|
|
1
|
+
class CardsController < ApplicationController
|
2
|
+
|
3
|
+
def index
|
4
|
+
load_cards
|
5
|
+
end
|
6
|
+
|
7
|
+
def show
|
8
|
+
load_cards
|
9
|
+
load_card
|
10
|
+
end
|
11
|
+
|
12
|
+
def new
|
13
|
+
load_cards
|
14
|
+
build_card
|
15
|
+
end
|
16
|
+
|
17
|
+
def create
|
18
|
+
load_cards
|
19
|
+
build_card
|
20
|
+
if @card.save
|
21
|
+
redirect_to card_path(@card)
|
22
|
+
else
|
23
|
+
render 'new'
|
24
|
+
end
|
25
|
+
end
|
26
|
+
|
27
|
+
private
|
28
|
+
|
29
|
+
def card_scope
|
30
|
+
Card.all
|
31
|
+
end
|
32
|
+
|
33
|
+
def load_cards
|
34
|
+
@cards ||= card_scope.to_a
|
35
|
+
end
|
36
|
+
|
37
|
+
def load_card
|
38
|
+
@card ||= card_scope.find(params[:id])
|
39
|
+
end
|
40
|
+
|
41
|
+
def build_card
|
42
|
+
@card ||= card_scope.build
|
43
|
+
@card.attributes = card_params
|
44
|
+
end
|
45
|
+
|
46
|
+
def card_params
|
47
|
+
note_params = params[:card]
|
48
|
+
note_params ? note_params.permit(:title, :body) : {}
|
49
|
+
end
|
50
|
+
|
51
|
+
end
|
File without changes
|
File without changes
|
File without changes
|
@@ -0,0 +1,27 @@
|
|
1
|
+
class Tests
|
2
|
+
class << self
|
3
|
+
|
4
|
+
def drop_all_tables
|
5
|
+
connection = ::ActiveRecord::Base.connection
|
6
|
+
connection.tables.each do |table|
|
7
|
+
connection.drop_table table
|
8
|
+
end
|
9
|
+
end
|
10
|
+
|
11
|
+
def migrate_test_database
|
12
|
+
print "\033[30m" # dark gray text
|
13
|
+
drop_all_tables
|
14
|
+
::ActiveRecord::Migrator.migrate("#{Rails.root}/db/migrate")
|
15
|
+
print "\033[0m"
|
16
|
+
end
|
17
|
+
|
18
|
+
def response_delay
|
19
|
+
@response_delay ||= 0
|
20
|
+
end
|
21
|
+
|
22
|
+
def response_delay=(seconds)
|
23
|
+
@response_delay = seconds
|
24
|
+
end
|
25
|
+
|
26
|
+
end
|
27
|
+
end
|
@@ -0,0 +1,15 @@
|
|
1
|
+
- @window_title = 'New card'
|
2
|
+
|
3
|
+
.panel
|
4
|
+
= render 'side'
|
5
|
+
|
6
|
+
.panel__main
|
7
|
+
= form_for @card, :html => { 'up-target' => '.panel__main' } do |form|
|
8
|
+
%dl.controls
|
9
|
+
%dt= form.label :title
|
10
|
+
%dd= form.text_field :title
|
11
|
+
%dt= form.label :body
|
12
|
+
%dd= form.text_area :body
|
13
|
+
|
14
|
+
.buttons
|
15
|
+
= form.submit 'Save card'
|
@@ -0,0 +1,12 @@
|
|
1
|
+
<!DOCTYPE html>
|
2
|
+
<html>
|
3
|
+
<head>
|
4
|
+
<title><%= @window_title || 'Default window title' %></title>
|
5
|
+
<%= stylesheet_link_tag 'application', media: 'all' %>
|
6
|
+
<%= javascript_include_tag 'application' %>
|
7
|
+
<%= csrf_meta_tags %>
|
8
|
+
</head>
|
9
|
+
<body>
|
10
|
+
<%= yield %>
|
11
|
+
</body>
|
12
|
+
</html>
|
data/spec_app/bin/bundle
ADDED
data/spec_app/bin/rails
ADDED
data/spec_app/bin/rake
ADDED
data/spec_app/bin/setup
ADDED
@@ -0,0 +1,29 @@
|
|
1
|
+
#!/usr/bin/env ruby
|
2
|
+
require 'pathname'
|
3
|
+
|
4
|
+
# path to your application root.
|
5
|
+
APP_ROOT = Pathname.new File.expand_path('../../', __FILE__)
|
6
|
+
|
7
|
+
Dir.chdir APP_ROOT do
|
8
|
+
# This script is a starting point to setup your application.
|
9
|
+
# Add necessary setup steps to this file:
|
10
|
+
|
11
|
+
puts "== Installing dependencies =="
|
12
|
+
system "gem install bundler --conservative"
|
13
|
+
system "bundle check || bundle install"
|
14
|
+
|
15
|
+
# puts "\n== Copying sample files =="
|
16
|
+
# unless File.exist?("config/database.yml")
|
17
|
+
# system "cp config/database.yml.sample config/database.yml"
|
18
|
+
# end
|
19
|
+
|
20
|
+
puts "\n== Preparing database =="
|
21
|
+
system "bin/rake db:setup"
|
22
|
+
|
23
|
+
puts "\n== Removing old logs and tempfiles =="
|
24
|
+
system "rm -f log/*"
|
25
|
+
system "rm -rf tmp/cache"
|
26
|
+
|
27
|
+
puts "\n== Restarting application server =="
|
28
|
+
system "touch tmp/restart.txt"
|
29
|
+
end
|
data/spec_app/bin/spring
ADDED
@@ -0,0 +1,18 @@
|
|
1
|
+
#!/usr/bin/env ruby
|
2
|
+
|
3
|
+
# This file loads spring without using Bundler, in order to be fast
|
4
|
+
# It gets overwritten when you run the `spring binstub` command
|
5
|
+
|
6
|
+
unless defined?(Spring)
|
7
|
+
require "rubygems"
|
8
|
+
require "bundler"
|
9
|
+
|
10
|
+
if match = Bundler.default_lockfile.read.match(/^GEM$.*?^ (?: )*spring \((.*?)\)$.*?^$/m)
|
11
|
+
ENV["GEM_PATH"] = ([Bundler.bundle_path.to_s] + Gem.path).join(File::PATH_SEPARATOR)
|
12
|
+
ENV["GEM_HOME"] = ""
|
13
|
+
Gem.paths = ENV
|
14
|
+
|
15
|
+
gem "spring", match[1]
|
16
|
+
require "spring/binstub"
|
17
|
+
end
|
18
|
+
end
|
@@ -0,0 +1,26 @@
|
|
1
|
+
require File.expand_path('../boot', __FILE__)
|
2
|
+
|
3
|
+
require 'rails/all'
|
4
|
+
|
5
|
+
# Require the gems listed in Gemfile, including any gems
|
6
|
+
# you've limited to :test, :development, or :production.
|
7
|
+
Bundler.require(*Rails.groups)
|
8
|
+
|
9
|
+
module SpecApp
|
10
|
+
class Application < Rails::Application
|
11
|
+
# Settings in config/environments/* take precedence over those specified here.
|
12
|
+
# Application configuration should go into files in config/initializers
|
13
|
+
# -- all .rb files in that directory are automatically loaded.
|
14
|
+
|
15
|
+
# Set Time.zone default to the specified zone and make Active Record auto-convert to this zone.
|
16
|
+
# Run "rake -D time" for a list of tasks for finding time zone names. Default is UTC.
|
17
|
+
# config.time_zone = 'Central Time (US & Canada)'
|
18
|
+
|
19
|
+
# The default locale is :en and all translations from config/locales/*.rb,yml are auto loaded.
|
20
|
+
# config.i18n.load_path += Dir[Rails.root.join('my', 'locales', '*.{rb,yml}').to_s]
|
21
|
+
# config.i18n.default_locale = :de
|
22
|
+
|
23
|
+
# Do not swallow errors in after_commit/after_rollback callbacks.
|
24
|
+
config.active_record.raise_in_transactional_callbacks = true
|
25
|
+
end
|
26
|
+
end
|
@@ -0,0 +1,8 @@
|
|
1
|
+
<%
|
2
|
+
rerun = File.file?('rerun.txt') ? IO.read('rerun.txt') : ""
|
3
|
+
rerun_opts = rerun.to_s.strip.empty? ? "--format #{ENV['CUCUMBER_FORMAT'] || 'progress'} features" : "--format #{ENV['CUCUMBER_FORMAT'] || 'pretty'} #{rerun}"
|
4
|
+
std_opts = "--format #{ENV['CUCUMBER_FORMAT'] || 'pretty'} --strict --tags ~@wip"
|
5
|
+
%>
|
6
|
+
default: <%= std_opts %> features
|
7
|
+
wip: --tags @wip:3 --wip features
|
8
|
+
rerun: <%= rerun_opts %> --format rerun --out rerun.txt --strict --tags ~@wip
|