rapid-app 0.1
Sign up to get free protection for your applications and to get access to all the features.
- data/.gitignore +6 -0
- data/.rspec +2 -0
- data/Gemfile +11 -0
- data/Rakefile +4 -0
- data/lib/rapid/app/settings.rb +259 -0
- data/lib/rapid/app/skeleton.rb +213 -0
- data/lib/rapid/app/version.rb +5 -0
- data/lib/rapid/app.rb +13 -0
- data/lib/rapid-app.rb +5 -0
- data/rapid-app.gemspec +33 -0
- data/spec/rapid/app/skeleton_spec.rb +50 -0
- data/spec/rapid/app_spec.rb +12 -0
- data/spec/spec_helper.rb +12 -0
- data/spec/support/more_string_matchers.rb +21 -0
- data/spec/support/rapid.rb +1 -0
- data/spec/templates/app/controllers/application_controller_spec.rb +32 -0
- data/spec/templates/app/helpers/application_helper_spec.rb +32 -0
- data/spec/templates/app/mailers/test_mailer_spec.rb +22 -0
- data/spec/templates/app/views/test_mailer/test_email.text.erb_spec.rb +36 -0
- data/spec/templates/config/application_spec.rb +168 -0
- data/spec/templates/config/boot_spec.rb +17 -0
- data/spec/templates/config/cucumber.yml_spec.rb +22 -0
- data/spec/templates/config/deploy/production_spec.rb +155 -0
- data/spec/templates/config/deploy_spec.rb +156 -0
- data/spec/templates/config/environment_spec.rb +22 -0
- data/spec/templates/config/environments/development_spec.rb +50 -0
- data/spec/templates/config/environments/production_spec.rb +50 -0
- data/spec/templates/config/environments/test_spec.rb +50 -0
- data/spec/templates/config/initializers/airbrake_spec.rb +70 -0
- data/spec/templates/config/initializers/backtrace_silencers_spec.rb +17 -0
- data/spec/templates/config/initializers/email_spec.rb +106 -0
- data/spec/templates/config/initializers/mime_types_spec.rb +17 -0
- data/spec/templates/config/initializers/secret_token_spec.rb +36 -0
- data/spec/templates/config/initializers/session_store_spec.rb +36 -0
- data/spec/templates/config/initializers/wrap_parameters_spec.rb +17 -0
- data/spec/templates/config/roodi.yml_spec.rb +92 -0
- data/spec/templates/config/routes_spec.rb +36 -0
- data/spec/templates/config/schedule_spec.rb +22 -0
- data/spec/templates/config.ru_spec.rb +22 -0
- data/spec/templates/db/migrate/create_jobs_spec.rb +17 -0
- data/spec/templates/features/step_definitions/email_steps_spec.rb +17 -0
- data/spec/templates/features/step_definitions/web_steps/browsing_steps_spec.rb +17 -0
- data/spec/templates/features/step_definitions/web_steps/debug_steps_spec.rb +17 -0
- data/spec/templates/features/step_definitions/web_steps/form_steps_spec.rb +17 -0
- data/spec/templates/features/step_definitions/web_steps/step_scoper_spec.rb +17 -0
- data/spec/templates/features/support/email_spec.rb +17 -0
- data/spec/templates/features/support/env_spec.rb +56 -0
- data/spec/templates/features/support/paths_spec.rb +22 -0
- data/spec/templates/features/support/selectors_spec.rb +22 -0
- data/spec/templates/features/support/with_scope_spec.rb +17 -0
- data/spec/templates/lib/tasks/cucumber.rake_spec.rb +17 -0
- data/spec/templates/lib/tasks/test.rake_spec.rb +147 -0
- data/spec/templates/lib/tasks/test_mailer.rake_spec.rb +17 -0
- data/spec/templates/rspec_spec.rb +17 -0
- data/spec/templates/script/delayed_job_spec.rb +17 -0
- data/spec/templates/script/rails_spec.rb +17 -0
- data/spec/templates/spec/factories_spec.rb +27 -0
- data/spec/templates/spec/spec_helper_spec.rb +56 -0
- data/spec/templates/test/test_helper_spec.rb +17 -0
- data/templates/app/controllers/application_controller.rb +3 -0
- data/templates/app/helpers/application_helper.rb +2 -0
- data/templates/app/mailers/test_mailer.rb +7 -0
- data/templates/app/views/test_mailer/test_email.text.erb +4 -0
- data/templates/config/application.rb +32 -0
- data/templates/config/boot.rb +6 -0
- data/templates/config/cucumber.yml +8 -0
- data/templates/config/deploy/production.rb +37 -0
- data/templates/config/deploy.rb +43 -0
- data/templates/config/environment.rb +5 -0
- data/templates/config/environments/development.rb +35 -0
- data/templates/config/environments/production.rb +64 -0
- data/templates/config/environments/test.rb +46 -0
- data/templates/config/initializers/airbrake.rb +9 -0
- data/templates/config/initializers/backtrace_silencers.rb +7 -0
- data/templates/config/initializers/email.rb +10 -0
- data/templates/config/initializers/mime_types.rb +5 -0
- data/templates/config/initializers/secret_token.rb +7 -0
- data/templates/config/initializers/session_store.rb +8 -0
- data/templates/config/initializers/wrap_parameters.rb +14 -0
- data/templates/config/roodi.yml +13 -0
- data/templates/config/routes.rb +3 -0
- data/templates/config/schedule.rb +1 -0
- data/templates/config.ru +4 -0
- data/templates/db/migrate/create_jobs.rb +22 -0
- data/templates/features/step_definitions/email_steps.rb +194 -0
- data/templates/features/step_definitions/web_steps/browsing_steps.rb +82 -0
- data/templates/features/step_definitions/web_steps/debug_steps.rb +3 -0
- data/templates/features/step_definitions/web_steps/form_steps.rb +210 -0
- data/templates/features/step_definitions/web_steps/step_scoper.rb +9 -0
- data/templates/features/support/email.rb +2 -0
- data/templates/features/support/env.rb +55 -0
- data/templates/features/support/paths.rb +27 -0
- data/templates/features/support/selectors.rb +24 -0
- data/templates/features/support/with_scope.rb +6 -0
- data/templates/lib/tasks/cucumber.rake +65 -0
- data/templates/lib/tasks/test.rake +49 -0
- data/templates/lib/tasks/test_mailer.rake +10 -0
- data/templates/rspec +2 -0
- data/templates/script/delayed_job +5 -0
- data/templates/script/rails +6 -0
- data/templates/spec/factories.rb +1 -0
- data/templates/spec/spec_helper.rb +47 -0
- data/templates/test/test_helper.rb +13 -0
- metadata +316 -0
@@ -0,0 +1,17 @@
|
|
1
|
+
require File.expand_path(File.dirname(__FILE__) + '/../../../../spec_helper')
|
2
|
+
|
3
|
+
describe "templates/features/step_definitions/web_steps/debug_steps.rb" do
|
4
|
+
|
5
|
+
include Rapid::Spec::Template
|
6
|
+
template_spec __FILE__
|
7
|
+
|
8
|
+
it "should push" do
|
9
|
+
push
|
10
|
+
@result.should include %(save_and_open_page)
|
11
|
+
end
|
12
|
+
|
13
|
+
it "should pull" do
|
14
|
+
pull
|
15
|
+
end
|
16
|
+
|
17
|
+
end
|
@@ -0,0 +1,17 @@
|
|
1
|
+
require File.expand_path(File.dirname(__FILE__) + '/../../../../spec_helper')
|
2
|
+
|
3
|
+
describe "templates/features/step_definitions/web_steps/form_steps.rb" do
|
4
|
+
|
5
|
+
include Rapid::Spec::Template
|
6
|
+
template_spec __FILE__
|
7
|
+
|
8
|
+
it "should push" do
|
9
|
+
push
|
10
|
+
@result.should include %(When /^(?:|I )fill in the following:$/ do |fields|)
|
11
|
+
end
|
12
|
+
|
13
|
+
it "should pull" do
|
14
|
+
pull
|
15
|
+
end
|
16
|
+
|
17
|
+
end
|
@@ -0,0 +1,17 @@
|
|
1
|
+
require File.expand_path(File.dirname(__FILE__) + '/../../../../spec_helper')
|
2
|
+
|
3
|
+
describe "templates/features/step_definitions/web_steps/step_scoper.rb" do
|
4
|
+
|
5
|
+
include Rapid::Spec::Template
|
6
|
+
template_spec __FILE__
|
7
|
+
|
8
|
+
it "should push" do
|
9
|
+
push
|
10
|
+
@result.should include %(When /^(.*) within ([^:]+)$/ do |step, parent|)
|
11
|
+
end
|
12
|
+
|
13
|
+
it "should pull" do
|
14
|
+
pull
|
15
|
+
end
|
16
|
+
|
17
|
+
end
|
@@ -0,0 +1,17 @@
|
|
1
|
+
require File.expand_path(File.dirname(__FILE__) + '/../../../spec_helper')
|
2
|
+
|
3
|
+
describe "templates/features/support/email.rb" do
|
4
|
+
|
5
|
+
include Rapid::Spec::Template
|
6
|
+
template_spec __FILE__
|
7
|
+
|
8
|
+
it "should push" do
|
9
|
+
push
|
10
|
+
@result.should include %(include EmailSpec::Helpers)
|
11
|
+
end
|
12
|
+
|
13
|
+
it "should pull" do
|
14
|
+
pull
|
15
|
+
end
|
16
|
+
|
17
|
+
end
|
@@ -0,0 +1,56 @@
|
|
1
|
+
require File.expand_path(File.dirname(__FILE__) + '/../../../spec_helper')
|
2
|
+
|
3
|
+
describe "templates/features/support/env.rb" do
|
4
|
+
|
5
|
+
include Rapid::Spec::Template
|
6
|
+
template_spec __FILE__
|
7
|
+
|
8
|
+
describe "database.mongoid" do
|
9
|
+
|
10
|
+
it "should push true" do
|
11
|
+
push 'database.mongoid' => true
|
12
|
+
@result.should include %(DatabaseCleaner.orm = 'mongoid')
|
13
|
+
end
|
14
|
+
|
15
|
+
it "should push false" do
|
16
|
+
push 'database.mongoid' => false
|
17
|
+
@result.should_not include %(DatabaseCleaner.orm = 'mongoid')
|
18
|
+
end
|
19
|
+
|
20
|
+
it "should pull true" do
|
21
|
+
pull 'database.mongoid' => true
|
22
|
+
@result['database.mongoid'].should == true
|
23
|
+
end
|
24
|
+
|
25
|
+
it "should pull false" do
|
26
|
+
pull 'database.mongoid' => false
|
27
|
+
@result['database.mongoid'].should == false
|
28
|
+
end
|
29
|
+
|
30
|
+
end
|
31
|
+
|
32
|
+
describe "database.active_record" do
|
33
|
+
|
34
|
+
it "should push true" do
|
35
|
+
push 'database.sqlite' => true
|
36
|
+
@result.should include %(\n DatabaseCleaner.strategy = :transaction)
|
37
|
+
end
|
38
|
+
|
39
|
+
it "should push false" do
|
40
|
+
push 'database.sqlite' => false
|
41
|
+
@result.should_not include %(\n DatabaseCleaner.strategy = :transaction)
|
42
|
+
end
|
43
|
+
|
44
|
+
it "should pull true" do
|
45
|
+
pull 'database.sqlite' => true
|
46
|
+
@result['database.active_record'].should == true
|
47
|
+
end
|
48
|
+
|
49
|
+
it "should pull false" do
|
50
|
+
pull 'database.sqlite' => false
|
51
|
+
@result['database.active_record'].should == false
|
52
|
+
end
|
53
|
+
|
54
|
+
end
|
55
|
+
|
56
|
+
end
|
@@ -0,0 +1,22 @@
|
|
1
|
+
require File.expand_path(File.dirname(__FILE__) + '/../../../spec_helper')
|
2
|
+
|
3
|
+
describe "templates/features/support/paths.rb" do
|
4
|
+
|
5
|
+
include Rapid::Spec::Template
|
6
|
+
template_spec __FILE__
|
7
|
+
|
8
|
+
describe "test.cucumber.paths.body" do
|
9
|
+
|
10
|
+
it "should push" do
|
11
|
+
push 'test.cucumber.paths.body' => "something else"
|
12
|
+
@result.should include %(something else)
|
13
|
+
end
|
14
|
+
|
15
|
+
it "should pull" do
|
16
|
+
pull 'test.cucumber.paths.body' => "something else"
|
17
|
+
@result['test.cucumber.paths.body'].should == %(something else)
|
18
|
+
end
|
19
|
+
|
20
|
+
end
|
21
|
+
|
22
|
+
end
|
@@ -0,0 +1,22 @@
|
|
1
|
+
require File.expand_path(File.dirname(__FILE__) + '/../../../spec_helper')
|
2
|
+
|
3
|
+
describe "templates/features/support/selectors.rb" do
|
4
|
+
|
5
|
+
include Rapid::Spec::Template
|
6
|
+
template_spec __FILE__
|
7
|
+
|
8
|
+
describe "test.cucumber.selectors.body" do
|
9
|
+
|
10
|
+
it "should push" do
|
11
|
+
push 'test.cucumber.selectors.body' => "something else"
|
12
|
+
@result.should include %(something else)
|
13
|
+
end
|
14
|
+
|
15
|
+
it "should pull" do
|
16
|
+
pull 'test.cucumber.selectors.body' => "something else"
|
17
|
+
@result['test.cucumber.selectors.body'].should == %(something else)
|
18
|
+
end
|
19
|
+
|
20
|
+
end
|
21
|
+
|
22
|
+
end
|
@@ -0,0 +1,17 @@
|
|
1
|
+
require File.expand_path(File.dirname(__FILE__) + '/../../../spec_helper')
|
2
|
+
|
3
|
+
describe "templates/features/support/with_scope.rb" do
|
4
|
+
|
5
|
+
include Rapid::Spec::Template
|
6
|
+
template_spec __FILE__
|
7
|
+
|
8
|
+
it "should push" do
|
9
|
+
push
|
10
|
+
@result.should include %(World(WithinHelpers))
|
11
|
+
end
|
12
|
+
|
13
|
+
it "should pull" do
|
14
|
+
pull
|
15
|
+
end
|
16
|
+
|
17
|
+
end
|
@@ -0,0 +1,17 @@
|
|
1
|
+
require File.expand_path(File.dirname(__FILE__) + '/../../../spec_helper')
|
2
|
+
|
3
|
+
describe "templates/lib/tasks/cucumber.rake" do
|
4
|
+
|
5
|
+
include Rapid::Spec::Template
|
6
|
+
template_spec __FILE__
|
7
|
+
|
8
|
+
it "should push" do
|
9
|
+
push
|
10
|
+
@result.should include %(namespace :cucumber do)
|
11
|
+
end
|
12
|
+
|
13
|
+
it "should pull" do
|
14
|
+
pull
|
15
|
+
end
|
16
|
+
|
17
|
+
end
|
@@ -0,0 +1,147 @@
|
|
1
|
+
require File.expand_path(File.dirname(__FILE__) + '/../../../spec_helper')
|
2
|
+
|
3
|
+
describe "templates/lib/tasks/test.rake" do
|
4
|
+
|
5
|
+
include Rapid::Spec::Template
|
6
|
+
template_spec __FILE__
|
7
|
+
|
8
|
+
describe "test.roodi" do
|
9
|
+
|
10
|
+
it "should push true" do
|
11
|
+
push 'test.coverage' => true, 'test.roodi' => true
|
12
|
+
@result.should include %(task :roodi do)
|
13
|
+
end
|
14
|
+
|
15
|
+
it "should push false" do
|
16
|
+
push 'test.roodi' => false
|
17
|
+
@result.should_not include %(task :roodi do)
|
18
|
+
end
|
19
|
+
|
20
|
+
it "should pull true" do
|
21
|
+
pull 'test.roodi' => true
|
22
|
+
@result['test.roodi'].should == true
|
23
|
+
end
|
24
|
+
|
25
|
+
it "should pull false" do
|
26
|
+
pull 'test.roodi' => false, 'test.coverage' => false
|
27
|
+
@result['test.roodi'].should == false
|
28
|
+
end
|
29
|
+
|
30
|
+
end
|
31
|
+
|
32
|
+
describe "test.coverage" do
|
33
|
+
|
34
|
+
it "should push true" do
|
35
|
+
push 'test.coverage' => true
|
36
|
+
@result.should include %(namespace :rcov do)
|
37
|
+
end
|
38
|
+
|
39
|
+
it "should push false" do
|
40
|
+
push 'test.coverage' => false
|
41
|
+
@result.should_not include %(namespace :rcov do)
|
42
|
+
end
|
43
|
+
|
44
|
+
it "should pull true" do
|
45
|
+
pull 'test.coverage' => true
|
46
|
+
@result['test.coverage.threshold'].should == "90"
|
47
|
+
end
|
48
|
+
|
49
|
+
it "should pull false" do
|
50
|
+
pull 'test.coverage' => false
|
51
|
+
@result['test.coverage'].should == false
|
52
|
+
end
|
53
|
+
|
54
|
+
end
|
55
|
+
|
56
|
+
describe "test.coverage.threshold" do
|
57
|
+
|
58
|
+
it "should push" do
|
59
|
+
push 'test.coverage.threshold' => 100
|
60
|
+
@result.should include %(--failure-threshold 100)
|
61
|
+
end
|
62
|
+
|
63
|
+
it "should pull" do
|
64
|
+
pull 'test.coverage.threshold' => 100
|
65
|
+
@result['test.coverage.threshold'].should == '100'
|
66
|
+
end
|
67
|
+
|
68
|
+
end
|
69
|
+
|
70
|
+
describe "test.rspec" do
|
71
|
+
|
72
|
+
it "should push true" do
|
73
|
+
push 'test.rspec' => true
|
74
|
+
@result.should include %(RSpec::Core::RakeTask)
|
75
|
+
@result.should include %(Rake::Task['rcov:spec'].invoke)
|
76
|
+
end
|
77
|
+
|
78
|
+
it "should push false" do
|
79
|
+
push 'test.rspec' => false
|
80
|
+
@result.should_not include %(RSpec::Core::RakeTask)
|
81
|
+
@result.should_not include %(Rake::Task['rcov:spec'].invoke)
|
82
|
+
end
|
83
|
+
|
84
|
+
it "should pull true" do
|
85
|
+
pull 'test.rspec' => true
|
86
|
+
@result['test.rspec'].should == true
|
87
|
+
end
|
88
|
+
|
89
|
+
it "should pull false" do
|
90
|
+
pull 'test.rspec' => false
|
91
|
+
@result['test.rspec'].should == false
|
92
|
+
end
|
93
|
+
|
94
|
+
end
|
95
|
+
|
96
|
+
describe "test.cucumber" do
|
97
|
+
|
98
|
+
it "should push true" do
|
99
|
+
push 'test.cucumber' => true
|
100
|
+
@result.should include %(Cucumber::Rake::Task)
|
101
|
+
@result.should include %(Rake::Task['rcov:cucumber'].invoke)
|
102
|
+
end
|
103
|
+
|
104
|
+
it "should push false" do
|
105
|
+
push 'test.cucumber' => false
|
106
|
+
@result.should_not include %(Cucumber::Rake::Task)
|
107
|
+
@result.should_not include %(Rake::Task['rcov:cucumber'].invoke)
|
108
|
+
end
|
109
|
+
|
110
|
+
it "should pull true" do
|
111
|
+
pull 'test.cucumber' => true
|
112
|
+
@result['test.cucumber'].should == true
|
113
|
+
end
|
114
|
+
|
115
|
+
it "should pull false" do
|
116
|
+
pull 'test.cucumber' => false
|
117
|
+
@result['test.cucumber'].should == false
|
118
|
+
end
|
119
|
+
|
120
|
+
end
|
121
|
+
|
122
|
+
describe "test.tasks" do
|
123
|
+
|
124
|
+
it "should push" do
|
125
|
+
push
|
126
|
+
@result.should include %(\n task :all => %w(db:migrate rapid:check roodi test cucumber))
|
127
|
+
@result.should include %(desc "Test the application using rapid:check, roodi, test, and cucumber")
|
128
|
+
end
|
129
|
+
|
130
|
+
it "should pull" do
|
131
|
+
pull
|
132
|
+
@result['test.tasks'].should == %(%w(db:migrate rapid:check roodi test cucumber))
|
133
|
+
end
|
134
|
+
|
135
|
+
it "should push rspec" do
|
136
|
+
push 'test.unit' => false, 'test.rspec' => true
|
137
|
+
@result.should include %(\n task :all => %w(db:migrate rapid:check roodi spec cucumber))
|
138
|
+
end
|
139
|
+
|
140
|
+
it "should pull rspec" do
|
141
|
+
pull 'test.unit' => false, 'test.rspec' => true
|
142
|
+
@result['test.tasks'].should == %(%w(db:migrate rapid:check roodi spec cucumber))
|
143
|
+
end
|
144
|
+
|
145
|
+
end
|
146
|
+
|
147
|
+
end
|
@@ -0,0 +1,17 @@
|
|
1
|
+
require File.expand_path(File.dirname(__FILE__) + '/../../../spec_helper')
|
2
|
+
|
3
|
+
describe "templates/lib/tasks/test_mailer.rake" do
|
4
|
+
|
5
|
+
include Rapid::Spec::Template
|
6
|
+
template_spec __FILE__
|
7
|
+
|
8
|
+
it "should push" do
|
9
|
+
push
|
10
|
+
@result.should include %(namespace :test do)
|
11
|
+
end
|
12
|
+
|
13
|
+
it "should pull" do
|
14
|
+
pull
|
15
|
+
end
|
16
|
+
|
17
|
+
end
|
@@ -0,0 +1,17 @@
|
|
1
|
+
require File.expand_path(File.dirname(__FILE__) + '/../spec_helper')
|
2
|
+
|
3
|
+
describe "templates/rspec" do
|
4
|
+
|
5
|
+
include Rapid::Spec::Template
|
6
|
+
template_spec __FILE__
|
7
|
+
|
8
|
+
it "should push" do
|
9
|
+
push
|
10
|
+
@result.should == "--color\n--format documentation\n"
|
11
|
+
end
|
12
|
+
|
13
|
+
it "should pull" do
|
14
|
+
pull
|
15
|
+
end
|
16
|
+
|
17
|
+
end
|
@@ -0,0 +1,17 @@
|
|
1
|
+
require File.expand_path(File.dirname(__FILE__) + '/../../spec_helper')
|
2
|
+
|
3
|
+
describe "templates/script/delayed_job" do
|
4
|
+
|
5
|
+
include Rapid::Spec::Template
|
6
|
+
template_spec __FILE__
|
7
|
+
|
8
|
+
it "should push" do
|
9
|
+
push
|
10
|
+
@result.should include %(Delayed::Command.new(ARGV).daemonize)
|
11
|
+
end
|
12
|
+
|
13
|
+
it "should pull" do
|
14
|
+
pull
|
15
|
+
end
|
16
|
+
|
17
|
+
end
|
@@ -0,0 +1,17 @@
|
|
1
|
+
require File.expand_path(File.dirname(__FILE__) + '/../../spec_helper')
|
2
|
+
|
3
|
+
describe "templates/script/rails" do
|
4
|
+
|
5
|
+
include Rapid::Spec::Template
|
6
|
+
template_spec __FILE__
|
7
|
+
|
8
|
+
it "should push" do
|
9
|
+
push
|
10
|
+
@result.should include %(require 'rails/commands')
|
11
|
+
end
|
12
|
+
|
13
|
+
it "should pull" do
|
14
|
+
pull
|
15
|
+
end
|
16
|
+
|
17
|
+
end
|
@@ -0,0 +1,27 @@
|
|
1
|
+
require File.expand_path(File.dirname(__FILE__) + '/../../spec_helper')
|
2
|
+
|
3
|
+
describe "templates/spec/factories.rb" do
|
4
|
+
|
5
|
+
include Rapid::Spec::Template
|
6
|
+
template_spec __FILE__
|
7
|
+
|
8
|
+
describe "test.rspec.factories.body" do
|
9
|
+
|
10
|
+
it "should push" do
|
11
|
+
push 'test.rspec.factories.body' => "some factories"
|
12
|
+
@result.should include %(some factories)
|
13
|
+
end
|
14
|
+
|
15
|
+
it "should pull" do
|
16
|
+
pull 'test.rspec.factories.body' => "some factories"
|
17
|
+
@result['test.rspec.factories.body'].should == "some factories"
|
18
|
+
end
|
19
|
+
|
20
|
+
it "should pull with content" do
|
21
|
+
pull 'test.rspec.factories.body' => "some factories\nfoo\nbar\n"
|
22
|
+
@result['test.rspec.factories.body'].should == "some factories\nfoo\nbar\n"
|
23
|
+
end
|
24
|
+
|
25
|
+
end
|
26
|
+
|
27
|
+
end
|
@@ -0,0 +1,56 @@
|
|
1
|
+
require File.expand_path(File.dirname(__FILE__) + '/../../spec_helper')
|
2
|
+
|
3
|
+
describe "templates/spec/spec_helper.rb" do
|
4
|
+
|
5
|
+
include Rapid::Spec::Template
|
6
|
+
template_spec __FILE__
|
7
|
+
|
8
|
+
describe "database.mongoid" do
|
9
|
+
|
10
|
+
it "should push true" do
|
11
|
+
push 'database.mongoid' => true
|
12
|
+
@result.should include %(DatabaseCleaner.orm = 'mongoid')
|
13
|
+
end
|
14
|
+
|
15
|
+
it "should push false" do
|
16
|
+
push 'database.mongoid' => false
|
17
|
+
@result.should_not include %(DatabaseCleaner.orm = 'mongoid')
|
18
|
+
end
|
19
|
+
|
20
|
+
it "should pull true" do
|
21
|
+
pull 'database.mongoid' => true
|
22
|
+
@result['database.mongoid'].should == true
|
23
|
+
end
|
24
|
+
|
25
|
+
it "should pull false" do
|
26
|
+
pull 'database.mongoid' => false
|
27
|
+
@result['database.mongoid'].should == false
|
28
|
+
end
|
29
|
+
|
30
|
+
end
|
31
|
+
|
32
|
+
describe "database.active_record" do
|
33
|
+
|
34
|
+
it "should push true" do
|
35
|
+
push 'database.sqlite' => true
|
36
|
+
@result.should include %( DatabaseCleaner.strategy = :transaction)
|
37
|
+
end
|
38
|
+
|
39
|
+
it "should push false" do
|
40
|
+
push 'database.sqlite' => false
|
41
|
+
@result.should_not include %( DatabaseCleaner.strategy = :transaction)
|
42
|
+
end
|
43
|
+
|
44
|
+
it "should pull true" do
|
45
|
+
pull 'database.sqlite' => true
|
46
|
+
@result['database.active_record'].should == true
|
47
|
+
end
|
48
|
+
|
49
|
+
it "should pull false" do
|
50
|
+
pull 'database.sqlite' => false
|
51
|
+
@result['database.active_record'].should == false
|
52
|
+
end
|
53
|
+
|
54
|
+
end
|
55
|
+
|
56
|
+
end
|
@@ -0,0 +1,17 @@
|
|
1
|
+
require File.expand_path(File.dirname(__FILE__) + '/../../spec_helper')
|
2
|
+
|
3
|
+
describe "templates/test/test_helper.rb" do
|
4
|
+
|
5
|
+
include Rapid::Spec::Template
|
6
|
+
template_spec __FILE__
|
7
|
+
|
8
|
+
it "should push" do
|
9
|
+
push
|
10
|
+
@result.should include %(class ActiveSupport::TestCase)
|
11
|
+
end
|
12
|
+
|
13
|
+
it "should pull" do
|
14
|
+
pull
|
15
|
+
end
|
16
|
+
|
17
|
+
end
|
@@ -0,0 +1,32 @@
|
|
1
|
+
require File.expand_path('../boot', __FILE__)
|
2
|
+
|
3
|
+
<% if rails_all? %>
|
4
|
+
require 'rails/all'
|
5
|
+
<% else %>
|
6
|
+
<%= comment_unless database.active_record? %>require "active_record/railtie"
|
7
|
+
require "action_controller/railtie"
|
8
|
+
require "action_mailer/railtie"
|
9
|
+
require "active_resource/railtie"
|
10
|
+
<%= comment_unless assets? %>require "sprockets/railtie"
|
11
|
+
<%= comment_unless test.unit? %>require "rails/test_unit/railtie"
|
12
|
+
<% end %>
|
13
|
+
|
14
|
+
if defined?(Bundler)
|
15
|
+
# If you precompile assets before deploying to production, use this line
|
16
|
+
Bundler.require *Rails.groups(:assets => %w(development test))
|
17
|
+
# If you want your assets lazily compiled in production, use this line
|
18
|
+
# Bundler.require(:default, :assets, Rails.env)
|
19
|
+
end
|
20
|
+
|
21
|
+
module <%= module_name %>
|
22
|
+
class Application < Rails::Application
|
23
|
+
# Set Time.zone default to the specified zone and make Active Record auto-convert to this zone.
|
24
|
+
# Run "rake -D time" for a list of tasks for finding time zone names. Default is UTC.
|
25
|
+
<% if timezone? %>
|
26
|
+
config.time_zone = '<%= timezone %>'
|
27
|
+
<% else %>
|
28
|
+
# config.time_zone = 'Central Time (US & Canada)'
|
29
|
+
<% end %>
|
30
|
+
<%= config.body %>
|
31
|
+
end
|
32
|
+
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:<%= test.cucumber.wip.max %> --wip features
|
8
|
+
rerun: <%%= rerun_opts %> --format rerun --out rerun.txt --strict --tags ~@wip
|
@@ -0,0 +1,37 @@
|
|
1
|
+
set :rails_env, "production"
|
2
|
+
set :user, "<%= deploy.production.user %>"
|
3
|
+
|
4
|
+
set :deploy_to, "<%= deploy.production.path %>"
|
5
|
+
set :branch, "<%= deploy.production.branch %>"
|
6
|
+
set :keep_releases, <%= deploy.production.keep %>
|
7
|
+
|
8
|
+
<% if deploy.production.bin? %>
|
9
|
+
set :bundle_cmd, "<%= deploy.production.bin %>/bundle"
|
10
|
+
|
11
|
+
<% end %>
|
12
|
+
<% if deploy.production.scheduler? %>
|
13
|
+
set :whenever_command, "<%= deploy.production.bin %>/bundle exec whenever"
|
14
|
+
|
15
|
+
<% end %>
|
16
|
+
role :web, "<%= deploy.production.domain %>"
|
17
|
+
role :app, "<%= deploy.production.domain %>"
|
18
|
+
role :db, "<%= deploy.production.domain %>", :primary => true
|
19
|
+
|
20
|
+
<% if deploy.production.rvm? %>
|
21
|
+
set :rvm_type, :<%= deploy.production.rvm.type %>
|
22
|
+
set :rvm_ruby_string, '<%= deploy.production.rvm.ruby %>@<%= deploy.production.rvm.gemset %>'
|
23
|
+
|
24
|
+
<% end %>
|
25
|
+
<% if deploy.production.server == 'passenger' %>
|
26
|
+
namespace :deploy do
|
27
|
+
|
28
|
+
task :start, :roles => :app do
|
29
|
+
run "touch #{deploy_to}/current/tmp/restart.txt"
|
30
|
+
end
|
31
|
+
|
32
|
+
task :restart, :roles => :app do
|
33
|
+
run "touch #{deploy_to}/current/tmp/restart.txt"
|
34
|
+
end
|
35
|
+
|
36
|
+
end
|
37
|
+
<% end %>
|