rails_apps_testing 0.2.1 → 0.2.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/CHANGELOG.textile +4 -0
- data/README.textile +44 -11
- data/lib/generators/testing/configure/configure_generator.rb +2 -2
- data/lib/rails_apps_testing/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 1d81ca00281b3258903db17ef151c12dc75b251c
|
4
|
+
data.tar.gz: 745036490c6ecc3ce7483d11f7e4ac1187b3fad2
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: e27a1afbf881949e6e00073ba27f29a8f940d89c570f9a783203d9a922f9a0269793cbbe285866966f05e6bd11ec13858ad8d7f547d347f6b5d33c4e3ffbba5d
|
7
|
+
data.tar.gz: b460c8835d1b6825519c9effcf648ca79f91a38f9b6d35e716d283760ce19a8e826b6a51b86fe435e43465e567080da2909fdb170c2ccf845231d05f0f7cc6cb
|
data/CHANGELOG.textile
CHANGED
data/README.textile
CHANGED
@@ -1,4 +1,12 @@
|
|
1
|
-
h1. !http://railsapps.github.io/images/rails-36x36.jpg(
|
1
|
+
h1. !http://railsapps.github.io/images/rails-36x36.jpg(RailsApps Testing Gem)! RailsApps Testing Gem
|
2
|
+
|
3
|
+
See a blog post about "Why I wrote this gem":http://blog.railsapps.org/post/84339605200/railsapps-testing-gem. I primarily use RSpec and Capybara for testing, but in principle, the gem could also set up Test::Unit or Cucumber frameworks. Also, you may want other configurations for RSpec, so let me know and we can extend the gem.
|
4
|
+
|
5
|
+
If you're new to testing, I've written a tutorial on Rails testing with RSPec:
|
6
|
+
|
7
|
+
* "RSpec Tutorial":http://railsapps.github.io/rspec.html
|
8
|
+
|
9
|
+
h2. About
|
2
10
|
|
3
11
|
Use this gem to set up a testing framework. The gem modifies a Rails application and configures:
|
4
12
|
|
@@ -11,21 +19,23 @@ Use this gem to set up a testing framework. The gem modifies a Rails application
|
|
11
19
|
|
12
20
|
This suite of gems is popular for testing Rails applications. Typically, a developer makes several small configuration changes when setting up a test framework with these gems. The configuration changes are easy to make manually, but this gem provides a generator to make the changes, for ease of use with an automated process such as an application template.
|
13
21
|
|
14
|
-
|
22
|
+
RailsApps Testing is a utility gem to use during development. You can remove it after setting up your test framework. It was originally written for use by the "Rails Composer":http://railsapps.github.io/rails-composer/ tool. Use Rails Composer to build any of the "RailApps example applications":http://railsapps.github.io/ for use as starter apps.
|
23
|
+
|
24
|
+
If you like the RailsApps Testing gem, you might be interested in the "RailsLayout gem":https://github.com/RailsApps/rails_layout which generates Rails application layout files for various front-end frameworks such as Bootstrap and Foundation.
|
15
25
|
|
16
26
|
h4. !http://railsapps.github.io/images/join/join-railsapps.png(Join RailsApps)!:http://railsapps.github.io/
|
17
27
|
|
18
28
|
h4. Support the RailsApps Project
|
19
29
|
|
20
|
-
If the
|
30
|
+
If the RailsApps Testing gem is useful to you, please accept our invitation to "join the RailsApps project":http://railsapps.github.io/. The RailsApps project provides example applications, tutorials, and starter tools, including the RailsApps Testing gem.
|
21
31
|
|
22
32
|
h2. Install a Testing Framework
|
23
33
|
|
24
|
-
The RailsApps project offers a tutorial:
|
34
|
+
The RailsApps project offers a tutorial on Rails testing with RSPec:
|
25
35
|
|
26
36
|
* "RSpec Tutorial":http://railsapps.github.io/rspec.html
|
27
37
|
|
28
|
-
To install a testing framework, add the gems you need. Then use the
|
38
|
+
To install a testing framework, add the gems you need. Then use the RailsApps Testing gem. It will set up and configure your testing framework.
|
29
39
|
|
30
40
|
Add the gems you need to your Rails application Gemfile:
|
31
41
|
|
@@ -45,7 +55,7 @@ group :test do
|
|
45
55
|
end
|
46
56
|
</pre>
|
47
57
|
|
48
|
-
You don't need the
|
58
|
+
You don't need the RailsApps Testing gem deployed to production, so put it in the @development@ group.
|
49
59
|
|
50
60
|
If you want to use a newer unreleased version from GitHub:
|
51
61
|
|
@@ -79,15 +89,15 @@ $ rails generate testing:configure rspec --force
|
|
79
89
|
|
80
90
|
h3. RSpec Configuration
|
81
91
|
|
82
|
-
The
|
92
|
+
The RailsApps Testing generator will remove the legacy *test/* folder if it exists (it is not needed for RSpec).
|
83
93
|
|
84
|
-
The
|
94
|
+
The RailsApps Testing generator will run @rails generate rspec:install@ to create two files and a folder:
|
85
95
|
|
86
96
|
* *.rspec*
|
87
97
|
* *spec/*
|
88
|
-
* *spec/
|
98
|
+
* *spec/rails_helper.rb*
|
89
99
|
|
90
|
-
Then the
|
100
|
+
Then the RailsApps Testing generator will configure RSpec.
|
91
101
|
|
92
102
|
It will modify the file *.rspec* to add:
|
93
103
|
|
@@ -95,6 +105,12 @@ It will modify the file *.rspec* to add:
|
|
95
105
|
--format documentation
|
96
106
|
</pre>
|
97
107
|
|
108
|
+
and will remove:
|
109
|
+
|
110
|
+
<pre>
|
111
|
+
--warnings
|
112
|
+
</pre>
|
113
|
+
|
98
114
|
It will modify the file *config/application.rb* to suppress creation of stub files that many developers don't use:
|
99
115
|
|
100
116
|
<pre>
|
@@ -146,7 +162,7 @@ RSpec.configure do |config|
|
|
146
162
|
end
|
147
163
|
</pre>
|
148
164
|
|
149
|
-
It will also modify *spec/
|
165
|
+
It will also modify *spec/rails_helper.rb*:
|
150
166
|
|
151
167
|
<pre>
|
152
168
|
config.use_transactional_fixtures = false
|
@@ -197,3 +213,20 @@ h2. MIT License
|
|
197
213
|
"MIT License":http://www.opensource.org/licenses/mit-license
|
198
214
|
|
199
215
|
Copyright © 2014 Daniel Kehoe
|
216
|
+
|
217
|
+
h2. Useful Links
|
218
|
+
|
219
|
+
|_. Getting Started |_. Articles |_. Tutorials |
|
220
|
+
| "Ruby on Rails":http://railsapps.github.io/ruby-and-rails.html | "Analytics for Rails":http://railsapps.github.io/rails-google-analytics.html | "Rails Bootstrap":http://railsapps.github.io/twitter-bootstrap-rails.html |
|
221
|
+
| "What is Ruby on Rails?":http://railsapps.github.io/what-is-ruby-rails.html | "Heroku and Rails":http://railsapps.github.io/rails-heroku-tutorial.html | "Rails Foundation":http://railsapps.github.io/rails-foundation.html |
|
222
|
+
| "Learn Ruby on Rails":http://learn-rails.com/learn-ruby-on-rails.html | "JavaScript and Rails":http://railsapps.github.io/rails-javascript-include-external.html | "RSpec Tutorial":http://railsapps.github.io/rspec.html |
|
223
|
+
| "Rails Tutorial":https://tutorials.railsapps.org/rails-tutorial | "Rails Environment Variables":http://railsapps.github.io/rails-environment-variables.html | "Rails Devise Tutorial":http://railsapps.github.io/tutorial-rails-devise.html |
|
224
|
+
| "Ruby on Rails Tutorial for Beginners":http://learn-rails.com/ruby-on-rails-tutorial-for-beginners | "Git and GitHub with Rails":http://railsapps.github.io/rails-git.html | "Devise RSpec":http://railsapps.github.io/tutorial-rails-devise-rspec-cucumber.html |
|
225
|
+
| "Install Ruby on Rails":http://railsapps.github.io/installing-rails.html | "Send Email with Rails":http://railsapps.github.io/rails-send-email.html | "Devise Bootstrap":http://railsapps.github.io/tutorial-rails-bootstrap-devise-cancan.html |
|
226
|
+
| "Install Ruby on Rails - Mac OS X":http://railsapps.github.io/installrubyonrails-mac.html | "Haml and Rails":http://railsapps.github.io/rails-haml.html | "Rails Membership Site with Stripe":https://tutorials.railsapps.org/rails-stripe-membership-saas |
|
227
|
+
| "Install Ruby on Rails - Ubuntu":http://railsapps.github.io/installrubyonrails-ubuntu.html | "Rails Application Layout":http://railsapps.github.io/rails-default-application-layout.html | "Rails Subscription Site with Recurly":https://tutorials.railsapps.org/rails-recurly-subscription-saas |
|
228
|
+
| "Ruby on Rails - Nitrous.io":http://railsapps.github.io/rubyonrails-nitrous-io.html | "HTML5 Boilerplate for Rails":http://railsapps.github.io/rails-html5-boilerplate.html | "Startup Prelaunch Signup Application":https://tutorials.railsapps.org/rails-prelaunch-signup |
|
229
|
+
| "Update Rails":http://railsapps.github.io/updating-rails.html | "Example Gemfiles for Rails":http://railsapps.github.io/rails-3-2-example-gemfile.html |
|
230
|
+
| "Rails Composer":http://railsapps.github.io/rails-composer/ | "Rails Application Templates":http://railsapps.github.io/rails-application-templates.html |
|
231
|
+
| "Rails Examples":http://railsapps.github.io/ | "Rails Product Planning":http://railsapps.github.io/rails-product-planning.html |
|
232
|
+
| "Rails Starter Apps":http://railsapps.github.io/rails-examples-tutorials.html | "Rails Project Management":http://railsapps.github.io/rails-project-management.html |
|
@@ -16,11 +16,11 @@ module Testing
|
|
16
16
|
run 'rm -rf test/' # Removing test folder (not needed for RSpec)
|
17
17
|
generate 'rspec:install'
|
18
18
|
inject_into_file '.rspec', "--format documentation\n", :after => "--color\n"
|
19
|
+
gsub_file '.rspec', /--warnings/, ''
|
19
20
|
tweaks = File.read(find_in_source_paths('application.rb'))
|
20
21
|
inject_into_file 'config/application.rb', tweaks + "\n", :after => "Rails::Application\n"
|
21
|
-
gsub_file 'spec/spec_helper.rb', /check_pending/, 'maintain_test_schema'
|
22
22
|
copy_file 'capybara.rb', 'spec/support/capybara.rb'
|
23
|
-
gsub_file 'spec/
|
23
|
+
gsub_file 'spec/rails_helper.rb', /config.use_transactional_fixtures = true/, "config.use_transactional_fixtures = false"
|
24
24
|
copy_file 'database_cleaner.rb', 'spec/support/database_cleaner.rb'
|
25
25
|
copy_file 'factory_girl.rb', 'spec/support/factory_girl.rb'
|
26
26
|
if File.exists?('config/initializers/devise.rb')
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: rails_apps_testing
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.2.
|
4
|
+
version: 0.2.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Daniel Kehoe
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-
|
11
|
+
date: 2014-06-02 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|