minitest-rails-capybara 0.5 → 0.5.1
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.
- data/CHANGELOG.rdoc +13 -0
- data/Manifest.txt +1 -0
- data/README.rdoc +8 -8
- data/lib/generators/mini_test/feature/templates/feature_spec.rb +2 -2
- data/lib/minitest-rails-capybara.rb +1 -1
- data/lib/minitest/rails/capybara.rb +14 -0
- data/minitest-rails-capybara.gemspec +3 -3
- data/test/test_spec.rb +35 -0
- metadata +3 -1
data/CHANGELOG.rdoc
CHANGED
@@ -1,3 +1,16 @@
|
|
1
|
+
=== 0.5.1 / 2013-01-11
|
2
|
+
|
3
|
+
* Add the Capybara spec DSL
|
4
|
+
|
5
|
+
https://github.com/blowmage/minitest-rails-capybara/compare/v0.5...v0.5.1
|
6
|
+
|
7
|
+
=== 0.5 / 2013-01-11
|
8
|
+
|
9
|
+
* Create Capybara::Rails::TestCase
|
10
|
+
* Add feature generator
|
11
|
+
|
12
|
+
https://github.com/blowmage/minitest-rails-capybara/compare/v0.1...v0.5
|
13
|
+
|
1
14
|
=== 0.1 / 2012-08-02
|
2
15
|
|
3
16
|
* Defer to minitest-capybara for Capybara integration
|
data/Manifest.txt
CHANGED
data/README.rdoc
CHANGED
@@ -38,11 +38,7 @@ To generate these feature tests, you can use the feature generator:
|
|
38
38
|
|
39
39
|
rails generate mini_test:feature CanAccessHome
|
40
40
|
|
41
|
-
|
42
|
-
|
43
|
-
rails generate mini_test:feature CanAccessHome --spec
|
44
|
-
|
45
|
-
You can now use Capybara in your acceptance tests!
|
41
|
+
You can now use Capybara in your feature tests!
|
46
42
|
|
47
43
|
require "minitest_helper"
|
48
44
|
|
@@ -53,12 +49,16 @@ You can now use Capybara in your acceptance tests!
|
|
53
49
|
end
|
54
50
|
end
|
55
51
|
|
56
|
-
Or
|
52
|
+
Or you can specify use of the Capybara's spec DSL by providing the <tt>--spec</tt> option:
|
53
|
+
|
54
|
+
rails generate mini_test:feature CanAccessHome --spec
|
55
|
+
|
56
|
+
Which will generate a feature test using the Capybara spec DSL:
|
57
57
|
|
58
58
|
require "minitest_helper"
|
59
59
|
|
60
|
-
|
61
|
-
|
60
|
+
feature "Can Access Home Feature Test" do
|
61
|
+
scenario "has content" do
|
62
62
|
visit root_path
|
63
63
|
assert page.has_content?("Home#index")
|
64
64
|
end
|
@@ -1,8 +1,8 @@
|
|
1
1
|
require "minitest_helper"
|
2
2
|
|
3
3
|
# To be handled correctly by Capybara this spec must end with "Feature Test"
|
4
|
-
|
5
|
-
|
4
|
+
feature "<%= class_name %> Feature Test" do
|
5
|
+
scenario "the test is sound" do
|
6
6
|
visit root_path
|
7
7
|
page.must_have_content "Hello World"
|
8
8
|
page.wont_have_content "Goobye All!"
|
@@ -15,3 +15,17 @@ module Capybara
|
|
15
15
|
end
|
16
16
|
end
|
17
17
|
end
|
18
|
+
|
19
|
+
# Enable Capybara's spec DSL using MiniTest::Spec
|
20
|
+
# This is very similar to the steak DSL
|
21
|
+
class MiniTest::Spec
|
22
|
+
class << self
|
23
|
+
alias :background :before
|
24
|
+
alias :scenario :it
|
25
|
+
alias :given :let
|
26
|
+
end
|
27
|
+
end
|
28
|
+
|
29
|
+
module Kernel # :nodoc:
|
30
|
+
alias :feature :describe
|
31
|
+
end
|
@@ -2,7 +2,7 @@
|
|
2
2
|
|
3
3
|
Gem::Specification.new do |s|
|
4
4
|
s.name = "minitest-rails-capybara"
|
5
|
-
s.version = "0.5.
|
5
|
+
s.version = "0.5.1.20130111101006"
|
6
6
|
|
7
7
|
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
|
8
8
|
s.authors = ["Mike Moore"]
|
@@ -10,14 +10,14 @@ Gem::Specification.new do |s|
|
|
10
10
|
s.description = "Adds Capybara feature tests in MiniTest and Rails."
|
11
11
|
s.email = ["mike@blowmage.com"]
|
12
12
|
s.extra_rdoc_files = ["CHANGELOG.rdoc", "Manifest.txt", "README.rdoc"]
|
13
|
-
s.files = [".autotest", ".gemtest", "CHANGELOG.rdoc", "LICENSE", "Manifest.txt", "README.rdoc", "Rakefile", "lib/generators/mini_test/feature/feature_generator.rb", "lib/generators/mini_test/feature/templates/feature_spec.rb", "lib/generators/mini_test/feature/templates/feature_test.rb", "lib/minitest-rails-capybara.rb", "lib/minitest/rails/capybara.rb", "minitest-rails-capybara.gemspec", "test/rails_helper.rb", "test/test_dsl.rb", "test/test_matchers.rb", "test/test_sanity.rb"]
|
13
|
+
s.files = [".autotest", ".gemtest", "CHANGELOG.rdoc", "LICENSE", "Manifest.txt", "README.rdoc", "Rakefile", "lib/generators/mini_test/feature/feature_generator.rb", "lib/generators/mini_test/feature/templates/feature_spec.rb", "lib/generators/mini_test/feature/templates/feature_test.rb", "lib/minitest-rails-capybara.rb", "lib/minitest/rails/capybara.rb", "minitest-rails-capybara.gemspec", "test/rails_helper.rb", "test/test_dsl.rb", "test/test_matchers.rb", "test/test_sanity.rb", "test/test_spec.rb"]
|
14
14
|
s.homepage = "http://blowmage.com/minitest-rails-capybara"
|
15
15
|
s.rdoc_options = ["--main", "README.rdoc"]
|
16
16
|
s.require_paths = ["lib"]
|
17
17
|
s.rubyforge_project = "minitest-rails-capybara"
|
18
18
|
s.rubygems_version = "1.8.23"
|
19
19
|
s.summary = "Capybara integration for MiniTest and Rails"
|
20
|
-
s.test_files = ["test/test_dsl.rb", "test/test_matchers.rb", "test/test_sanity.rb"]
|
20
|
+
s.test_files = ["test/test_dsl.rb", "test/test_matchers.rb", "test/test_sanity.rb", "test/test_spec.rb"]
|
21
21
|
|
22
22
|
if s.respond_to? :specification_version then
|
23
23
|
s.specification_version = 3
|
data/test/test_spec.rb
ADDED
@@ -0,0 +1,35 @@
|
|
1
|
+
require "rails_helper"
|
2
|
+
|
3
|
+
feature "Capybara Spec DSL Feature Test" do
|
4
|
+
|
5
|
+
scenario "works unnested" do
|
6
|
+
assert true
|
7
|
+
end
|
8
|
+
|
9
|
+
feature "when nested" do
|
10
|
+
scenario "works nested" do
|
11
|
+
assert true
|
12
|
+
end
|
13
|
+
end
|
14
|
+
|
15
|
+
given(:thing) { "I am a thing." }
|
16
|
+
|
17
|
+
scenario "given works unnested" do
|
18
|
+
assert_equal "I am a thing.", thing
|
19
|
+
end
|
20
|
+
|
21
|
+
feature "given nested" do
|
22
|
+
|
23
|
+
given(:widget) { "I am a widget." }
|
24
|
+
|
25
|
+
scenario "works nested" do
|
26
|
+
assert_equal "I am a thing.", thing
|
27
|
+
end
|
28
|
+
|
29
|
+
scenario "widget works too" do
|
30
|
+
assert_equal "I am a widget.", widget
|
31
|
+
end
|
32
|
+
|
33
|
+
end
|
34
|
+
|
35
|
+
end
|
metadata
CHANGED
@@ -2,7 +2,7 @@
|
|
2
2
|
name: minitest-rails-capybara
|
3
3
|
version: !ruby/object:Gem::Version
|
4
4
|
prerelease:
|
5
|
-
version:
|
5
|
+
version: 0.5.1
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
8
8
|
- Mike Moore
|
@@ -134,6 +134,7 @@ files:
|
|
134
134
|
- test/test_dsl.rb
|
135
135
|
- test/test_matchers.rb
|
136
136
|
- test/test_sanity.rb
|
137
|
+
- test/test_spec.rb
|
137
138
|
homepage: http://blowmage.com/minitest-rails-capybara
|
138
139
|
licenses: []
|
139
140
|
post_install_message:
|
@@ -164,3 +165,4 @@ test_files:
|
|
164
165
|
- test/test_dsl.rb
|
165
166
|
- test/test_matchers.rb
|
166
167
|
- test/test_sanity.rb
|
168
|
+
- test/test_spec.rb
|