rspec-rails 2.0.0.beta.9.1 → 2.0.0.beta.10
Sign up to get free protection for your applications and to get access to all the features.
- data/Rakefile +1 -1
- data/VERSION +1 -1
- data/features/model_specs/transactional_examples.feature +25 -0
- data/lib/generators/rspec/controller/controller_generator.rb +2 -1
- data/lib/generators/rspec/install/install_generator.rb +4 -10
- data/lib/{rspec/rails → generators/rspec/install/templates/lib}/tasks/rspec.rake +1 -0
- data/lib/generators/rspec/install/templates/spec/spec_helper.rb +2 -0
- data/lib/rspec-rails.rb +1 -5
- data/lib/rspec/rails.rb +2 -5
- data/lib/rspec/rails/adapters.rb +3 -0
- data/lib/rspec/rails/configuration.rb +8 -0
- data/lib/rspec/rails/example/controller_example_group.rb +23 -21
- data/lib/rspec/rails/example/helper_example_group.rb +31 -30
- data/lib/rspec/rails/example/mailer_example_group.rb +20 -18
- data/lib/rspec/rails/example/request_example_group.rb +26 -24
- data/lib/rspec/rails/example/view_example_group.rb +51 -49
- data/lib/rspec/rails/fixture_support.rb +31 -0
- data/lib/rspec/rails/matchers.rb +2 -0
- data/rspec-rails.gemspec +10 -12
- data/spec/rspec/rails/example/controller_example_group_spec.rb +9 -7
- data/spec/rspec/rails/example/helper_example_group_spec.rb +16 -14
- data/spec/rspec/rails/example/mailer_example_group_spec.rb +9 -7
- data/spec/rspec/rails/example/request_example_group_spec.rb +9 -7
- data/spec/rspec/rails/example/view_example_group_spec.rb +59 -57
- data/spec/rspec/rails/example/view_rendering_spec.rb +50 -49
- metadata +10 -13
- data/lib/generators/rspec/install/templates/config/initializers/rspec_generator.rb.tt +0 -6
- data/lib/rspec/rails/transactional_database_support.rb +0 -40
- data/spec/rspec/rails/transactional_database_support_spec.rb +0 -54
data/Rakefile
CHANGED
@@ -25,7 +25,7 @@ begin
|
|
25
25
|
gem.homepage = "http://github.com/rspec/rspec-rails"
|
26
26
|
gem.authors = ["David Chelimsky", "Chad Humphries"]
|
27
27
|
gem.rubyforge_project = "rspec"
|
28
|
-
gem.add_dependency "rspec",
|
28
|
+
gem.add_dependency "rspec", gem.version
|
29
29
|
gem.add_dependency "webrat", ">= 0.7.0"
|
30
30
|
gem.post_install_message = <<-EOM
|
31
31
|
#{"*"*50}
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
2.0.0.beta.
|
1
|
+
2.0.0.beta.10
|
@@ -72,7 +72,32 @@ Feature: transactional examples
|
|
72
72
|
it "has one after one was created in a previous example" do
|
73
73
|
Widget.count.should == 1
|
74
74
|
end
|
75
|
+
|
76
|
+
after(:all) { Widget.destroy_all }
|
75
77
|
end
|
76
78
|
"""
|
77
79
|
When I run "rspec spec/models/widget_spec.rb"
|
78
80
|
Then I should see "3 examples, 0 failures"
|
81
|
+
|
82
|
+
Scenario: run in transactions with fixture
|
83
|
+
Given a file named "spec/models/thing_spec.rb" with:
|
84
|
+
"""
|
85
|
+
require "spec_helper"
|
86
|
+
|
87
|
+
describe Thing do
|
88
|
+
fixtures :things
|
89
|
+
it "fixture method defined" do
|
90
|
+
things(:one)
|
91
|
+
end
|
92
|
+
end
|
93
|
+
"""
|
94
|
+
Given a file named "spec/fixtures/things.yml" with:
|
95
|
+
"""
|
96
|
+
one:
|
97
|
+
name: MyString
|
98
|
+
"""
|
99
|
+
When I run "rspec spec/models/thing_spec.rb"
|
100
|
+
Then I should see "1 example, 0 failures"
|
101
|
+
|
102
|
+
|
103
|
+
|
@@ -11,20 +11,14 @@ DESC
|
|
11
11
|
@source_root ||= File.expand_path(File.join(File.dirname(__FILE__), 'templates'))
|
12
12
|
end
|
13
13
|
|
14
|
-
def copy_initializer_files
|
15
|
-
inside "config" do
|
16
|
-
empty_directory "initializers", :verbose => false
|
17
|
-
|
18
|
-
inside "initializers" do
|
19
|
-
template "rspec_generator.rb.tt", "rspec_generator.rb"
|
20
|
-
end
|
21
|
-
end
|
22
|
-
end
|
23
|
-
|
24
14
|
def copy_spec_files
|
25
15
|
directory 'spec'
|
26
16
|
end
|
27
17
|
|
18
|
+
def copy_lib_files
|
19
|
+
directory 'lib'
|
20
|
+
end
|
21
|
+
|
28
22
|
def copy_autotest_files
|
29
23
|
directory 'autotest'
|
30
24
|
end
|
@@ -18,6 +18,8 @@ Rspec.configure do |config|
|
|
18
18
|
# config.mock_with :rr
|
19
19
|
config.mock_with :rspec
|
20
20
|
|
21
|
+
config.fixture_path = "#{::Rails.root}/spec/fixtures"
|
22
|
+
|
21
23
|
# If you'd prefer not to run each of your examples within a transaction,
|
22
24
|
# uncomment the following line.
|
23
25
|
# config.use_transactional_examples = false
|
data/lib/rspec-rails.rb
CHANGED
data/lib/rspec/rails.rb
CHANGED
@@ -4,11 +4,8 @@ require 'rspec/rails/extensions'
|
|
4
4
|
require 'rspec/rails/null_resolver'
|
5
5
|
require 'rspec/rails/view_rendering'
|
6
6
|
require 'rspec/rails/adapters'
|
7
|
-
require 'rspec/rails/transactional_database_support'
|
8
7
|
require 'rspec/rails/matchers'
|
9
|
-
require 'rspec/rails/
|
8
|
+
require 'rspec/rails/fixture_support'
|
10
9
|
require 'rspec/rails/mocks'
|
10
|
+
require 'rspec/rails/example'
|
11
11
|
|
12
|
-
RSpec.configure do |c|
|
13
|
-
c.add_option :use_transactional_examples, :type => :boolean, :default => true
|
14
|
-
end
|
data/lib/rspec/rails/adapters.rb
CHANGED
@@ -1,33 +1,35 @@
|
|
1
1
|
require 'action_controller'
|
2
2
|
require 'webrat'
|
3
3
|
|
4
|
-
module
|
5
|
-
|
4
|
+
module RSpec::Rails
|
5
|
+
module ControllerExampleGroup
|
6
|
+
extend ActiveSupport::Concern
|
6
7
|
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
8
|
+
include RSpec::Rails::SetupAndTeardownAdapter
|
9
|
+
include RSpec::Rails::TestUnitAssertionAdapter
|
10
|
+
include ActionController::TestCase::Behavior
|
11
|
+
include RSpec::Rails::ViewRendering
|
12
|
+
include Webrat::Matchers
|
13
|
+
include Webrat::Methods
|
14
|
+
include RSpec::Matchers
|
14
15
|
|
15
|
-
|
16
|
+
attr_reader :controller
|
16
17
|
|
17
|
-
|
18
|
-
|
19
|
-
|
18
|
+
module ClassMethods
|
19
|
+
def controller_class
|
20
|
+
describes
|
21
|
+
end
|
20
22
|
end
|
21
|
-
end
|
22
23
|
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
24
|
+
included do
|
25
|
+
before do
|
26
|
+
@routes = ::Rails.application.routes
|
27
|
+
ActionController::Base.allow_forgery_protection = false
|
28
|
+
end
|
27
29
|
end
|
28
|
-
end
|
29
30
|
|
30
|
-
|
31
|
-
|
31
|
+
RSpec.configure do |c|
|
32
|
+
c.include self, :example_group => { :file_path => /\bspec\/controllers\// }
|
33
|
+
end
|
32
34
|
end
|
33
35
|
end
|
@@ -1,43 +1,44 @@
|
|
1
1
|
require 'webrat'
|
2
2
|
require 'rspec/rails/view_assigns'
|
3
3
|
|
4
|
-
module
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
4
|
+
module RSpec::Rails
|
5
|
+
module HelperExampleGroup
|
6
|
+
extend ActiveSupport::Concern
|
7
|
+
|
8
|
+
include RSpec::Rails::SetupAndTeardownAdapter
|
9
|
+
include RSpec::Rails::TestUnitAssertionAdapter
|
10
|
+
include ActionView::TestCase::Behavior
|
11
|
+
include RSpec::Rails::ViewAssigns
|
12
|
+
include Webrat::Matchers
|
13
|
+
|
14
|
+
module ClassMethods
|
15
|
+
def determine_default_helper_class(ignore)
|
16
|
+
describes
|
17
|
+
end
|
16
18
|
end
|
17
|
-
end
|
18
19
|
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
20
|
+
module InstanceMethods
|
21
|
+
# Returns an instance of ActionView::Base instrumented with this helper and
|
22
|
+
# any of the built-in rails helpers.
|
23
|
+
def helper
|
24
|
+
_view
|
25
|
+
end
|
25
26
|
|
26
|
-
|
27
|
+
private
|
27
28
|
|
28
|
-
|
29
|
-
|
29
|
+
def _controller_path
|
30
|
+
running_example.example_group.describes.to_s.sub(/Helper/,'').underscore
|
31
|
+
end
|
30
32
|
end
|
31
|
-
end
|
32
33
|
|
33
|
-
|
34
|
-
|
35
|
-
|
34
|
+
included do
|
35
|
+
before do
|
36
|
+
controller.controller_path = _controller_path
|
37
|
+
end
|
36
38
|
end
|
37
|
-
end
|
38
39
|
|
39
|
-
|
40
|
-
|
40
|
+
RSpec.configure do |c|
|
41
|
+
c.include self, :example_group => { :file_path => /\bspec\/helpers\// }
|
42
|
+
end
|
41
43
|
end
|
42
44
|
end
|
43
|
-
|
@@ -1,27 +1,29 @@
|
|
1
1
|
require 'webrat'
|
2
2
|
|
3
|
-
module
|
4
|
-
|
3
|
+
module RSpec::Rails
|
4
|
+
module MailerExampleGroup
|
5
|
+
extend ActiveSupport::Concern
|
5
6
|
|
6
|
-
|
7
|
-
|
7
|
+
include Webrat::Matchers
|
8
|
+
include RSpec::Matchers
|
8
9
|
|
9
|
-
|
10
|
-
|
11
|
-
|
10
|
+
def read_fixture(action)
|
11
|
+
IO.readlines(File.join(Rails.root, 'spec', 'fixtures', self.described_class.name.underscore, action))
|
12
|
+
end
|
12
13
|
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
14
|
+
included do
|
15
|
+
before do
|
16
|
+
ActionMailer::Base.delivery_method = :test
|
17
|
+
ActionMailer::Base.perform_deliveries = true
|
18
|
+
ActionMailer::Base.deliveries.clear
|
19
|
+
@expected = Mail.new
|
20
|
+
@expected.content_type ["text", "plain", { "charset" => "utf-8" }]
|
21
|
+
@expected.mime_version = '1.0'
|
22
|
+
end
|
21
23
|
end
|
22
|
-
end
|
23
24
|
|
24
|
-
|
25
|
-
|
25
|
+
RSpec.configure do |c|
|
26
|
+
c.include self, :example_group => { :file_path => /\bspec\/mailers\// }
|
27
|
+
end
|
26
28
|
end
|
27
29
|
end
|
@@ -1,35 +1,37 @@
|
|
1
1
|
require 'action_dispatch'
|
2
2
|
require 'webrat'
|
3
3
|
|
4
|
-
module
|
5
|
-
|
4
|
+
module RSpec::Rails
|
5
|
+
module RequestExampleGroup
|
6
|
+
extend ActiveSupport::Concern
|
6
7
|
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
8
|
+
include ActionDispatch::Integration::Runner
|
9
|
+
include RSpec::Rails::TestUnitAssertionAdapter
|
10
|
+
include ActionDispatch::Assertions
|
11
|
+
include Webrat::Matchers
|
12
|
+
include Webrat::Methods
|
13
|
+
include RSpec::Matchers
|
13
14
|
|
14
|
-
|
15
|
-
|
16
|
-
|
15
|
+
included do
|
16
|
+
before do
|
17
|
+
@router = ::Rails.application.routes
|
18
|
+
end
|
19
|
+
end
|
20
|
+
|
21
|
+
def app
|
22
|
+
::Rails.application
|
17
23
|
end
|
18
|
-
end
|
19
|
-
|
20
|
-
def app
|
21
|
-
::Rails.application
|
22
|
-
end
|
23
24
|
|
24
|
-
|
25
|
-
|
26
|
-
|
25
|
+
def last_response
|
26
|
+
response
|
27
|
+
end
|
27
28
|
|
28
|
-
|
29
|
-
|
30
|
-
|
29
|
+
Webrat.configure do |config|
|
30
|
+
config.mode = :rack
|
31
|
+
end
|
31
32
|
|
32
|
-
|
33
|
-
|
33
|
+
RSpec.configure do |c|
|
34
|
+
c.include self, :example_group => { :file_path => /\bspec\/requests\// }
|
35
|
+
end
|
34
36
|
end
|
35
37
|
end
|
@@ -1,62 +1,64 @@
|
|
1
1
|
require 'webrat'
|
2
2
|
require 'rspec/rails/view_assigns'
|
3
3
|
|
4
|
-
module
|
5
|
-
|
6
|
-
|
7
|
-
include RSpec::Rails::SetupAndTeardownAdapter
|
8
|
-
include RSpec::Rails::TestUnitAssertionAdapter
|
9
|
-
include ActionView::TestCase::Behavior
|
10
|
-
include RSpec::Rails::ViewAssigns
|
11
|
-
include Webrat::Matchers
|
12
|
-
|
13
|
-
module InstanceMethods
|
14
|
-
def response
|
15
|
-
RSpec.deprecate("response", "rendered")
|
16
|
-
rendered
|
17
|
-
end
|
4
|
+
module RSpec::Rails
|
5
|
+
module ViewExampleGroup
|
6
|
+
extend ActiveSupport::Concern
|
18
7
|
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
#
|
25
|
-
# Delegates to ActionView::Base#render, so see documentation on that for more
|
26
|
-
# info.
|
27
|
-
#
|
28
|
-
# The only addition is that you can call render with no arguments, and RSpec
|
29
|
-
# will pass the top level description to render:
|
30
|
-
#
|
31
|
-
# describe "widgets/new.html.erb" do
|
32
|
-
# it "shows all the widgets" do
|
33
|
-
# render # => view.render(:file => "widgets/new.html.erb")
|
34
|
-
# ...
|
35
|
-
# end
|
36
|
-
# end
|
37
|
-
def render(options={}, local_assigns={}, &block)
|
38
|
-
options = {:template => _default_file_to_render} if Hash === options and options.empty?
|
39
|
-
super(options, local_assigns, &block)
|
40
|
-
end
|
8
|
+
include RSpec::Rails::SetupAndTeardownAdapter
|
9
|
+
include RSpec::Rails::TestUnitAssertionAdapter
|
10
|
+
include ActionView::TestCase::Behavior
|
11
|
+
include RSpec::Rails::ViewAssigns
|
12
|
+
include Webrat::Matchers
|
41
13
|
|
42
|
-
|
14
|
+
module InstanceMethods
|
15
|
+
def response
|
16
|
+
RSpec.deprecate("response", "rendered")
|
17
|
+
rendered
|
18
|
+
end
|
43
19
|
|
44
|
-
|
45
|
-
|
46
|
-
|
20
|
+
# :callseq:
|
21
|
+
# render
|
22
|
+
# render(:template => "widgets/new.html.erb")
|
23
|
+
# render({:partial => "widgets/widget.html.erb"}, {... locals ...})
|
24
|
+
# render({:partial => "widgets/widget.html.erb"}, {... locals ...}) do ... end
|
25
|
+
#
|
26
|
+
# Delegates to ActionView::Base#render, so see documentation on that for more
|
27
|
+
# info.
|
28
|
+
#
|
29
|
+
# The only addition is that you can call render with no arguments, and RSpec
|
30
|
+
# will pass the top level description to render:
|
31
|
+
#
|
32
|
+
# describe "widgets/new.html.erb" do
|
33
|
+
# it "shows all the widgets" do
|
34
|
+
# render # => view.render(:file => "widgets/new.html.erb")
|
35
|
+
# ...
|
36
|
+
# end
|
37
|
+
# end
|
38
|
+
def render(options={}, local_assigns={}, &block)
|
39
|
+
options = {:template => _default_file_to_render} if Hash === options and options.empty?
|
40
|
+
super(options, local_assigns, &block)
|
41
|
+
end
|
42
|
+
|
43
|
+
private
|
47
44
|
|
48
|
-
|
49
|
-
|
45
|
+
def _default_file_to_render
|
46
|
+
running_example.example_group.top_level_description
|
47
|
+
end
|
48
|
+
|
49
|
+
def _controller_path
|
50
|
+
_default_file_to_render.split("/")[0..-2].join("/")
|
51
|
+
end
|
50
52
|
end
|
51
|
-
end
|
52
53
|
|
53
|
-
|
54
|
-
|
55
|
-
|
54
|
+
included do
|
55
|
+
before do
|
56
|
+
controller.controller_path = _controller_path
|
57
|
+
end
|
56
58
|
end
|
57
|
-
end
|
58
59
|
|
59
|
-
|
60
|
-
|
60
|
+
RSpec.configure do |c|
|
61
|
+
c.include self, :example_group => { :file_path => /\bspec\/views\// }
|
62
|
+
end
|
61
63
|
end
|
62
64
|
end
|
@@ -0,0 +1,31 @@
|
|
1
|
+
module RSpec
|
2
|
+
module Rails
|
3
|
+
module FixtureSupport
|
4
|
+
extend ActiveSupport::Concern
|
5
|
+
|
6
|
+
include RSpec::Rails::SetupAndTeardownAdapter
|
7
|
+
include RSpec::Rails::TestUnitAssertionAdapter
|
8
|
+
|
9
|
+
included do
|
10
|
+
if RSpec.configuration.use_transactional_fixtures
|
11
|
+
# TODO - figure out how to move this outside the included block
|
12
|
+
include ActiveRecord::TestFixtures
|
13
|
+
|
14
|
+
self.fixture_path = RSpec.configuration.fixture_path
|
15
|
+
self.use_transactional_fixtures = RSpec.configuration.use_transactional_fixtures
|
16
|
+
self.use_instantiated_fixtures = RSpec.configuration.use_instantiated_fixtures
|
17
|
+
fixtures RSpec.configuration.global_fixtures if RSpec.configuration.global_fixtures
|
18
|
+
end
|
19
|
+
end
|
20
|
+
end
|
21
|
+
end
|
22
|
+
end
|
23
|
+
|
24
|
+
RSpec.configure do |c|
|
25
|
+
c.include RSpec::Rails::FixtureSupport
|
26
|
+
c.add_setting :use_transactional_fixtures, :default => true
|
27
|
+
c.add_setting :use_transactional_examples, :alias => :use_transactional_fixtures
|
28
|
+
c.add_setting :use_instantiated_fixtures
|
29
|
+
c.add_setting :global_fixtures
|
30
|
+
c.add_setting :fixture_path
|
31
|
+
end
|
data/lib/rspec/rails/matchers.rb
CHANGED
data/rspec-rails.gemspec
CHANGED
@@ -5,11 +5,11 @@
|
|
5
5
|
|
6
6
|
Gem::Specification.new do |s|
|
7
7
|
s.name = %q{rspec-rails}
|
8
|
-
s.version = "2.0.0.beta.
|
8
|
+
s.version = "2.0.0.beta.10"
|
9
9
|
|
10
10
|
s.required_rubygems_version = Gem::Requirement.new("> 1.3.1") if s.respond_to? :required_rubygems_version=
|
11
11
|
s.authors = ["David Chelimsky", "Chad Humphries"]
|
12
|
-
s.date = %q{2010-
|
12
|
+
s.date = %q{2010-06-02}
|
13
13
|
s.description = %q{RSpec-2 for Rails-3}
|
14
14
|
s.email = %q{dchelimsky@gmail.com;chad.humphries@gmail.com}
|
15
15
|
s.extra_rdoc_files = [
|
@@ -43,7 +43,7 @@ Gem::Specification.new do |s|
|
|
43
43
|
"lib/generators/rspec/helper/templates/helper_spec.rb",
|
44
44
|
"lib/generators/rspec/install/install_generator.rb",
|
45
45
|
"lib/generators/rspec/install/templates/autotest/discover.rb",
|
46
|
-
"lib/generators/rspec/install/templates/
|
46
|
+
"lib/generators/rspec/install/templates/lib/tasks/rspec.rake",
|
47
47
|
"lib/generators/rspec/install/templates/spec/spec_helper.rb",
|
48
48
|
"lib/generators/rspec/integration/integration_generator.rb",
|
49
49
|
"lib/generators/rspec/integration/templates/request_spec.rb",
|
@@ -67,6 +67,7 @@ Gem::Specification.new do |s|
|
|
67
67
|
"lib/rspec-rails.rb",
|
68
68
|
"lib/rspec/rails.rb",
|
69
69
|
"lib/rspec/rails/adapters.rb",
|
70
|
+
"lib/rspec/rails/configuration.rb",
|
70
71
|
"lib/rspec/rails/example.rb",
|
71
72
|
"lib/rspec/rails/example/controller_example_group.rb",
|
72
73
|
"lib/rspec/rails/example/helper_example_group.rb",
|
@@ -75,6 +76,7 @@ Gem::Specification.new do |s|
|
|
75
76
|
"lib/rspec/rails/example/view_example_group.rb",
|
76
77
|
"lib/rspec/rails/extensions.rb",
|
77
78
|
"lib/rspec/rails/extensions/active_record/base.rb",
|
79
|
+
"lib/rspec/rails/fixture_support.rb",
|
78
80
|
"lib/rspec/rails/matchers.rb",
|
79
81
|
"lib/rspec/rails/mocks.rb",
|
80
82
|
"lib/rspec/rails/monkey.rb",
|
@@ -82,8 +84,6 @@ Gem::Specification.new do |s|
|
|
82
84
|
"lib/rspec/rails/monkey/action_view/test_case.rb",
|
83
85
|
"lib/rspec/rails/monkey/active_support/notifications/fanout.rb",
|
84
86
|
"lib/rspec/rails/null_resolver.rb",
|
85
|
-
"lib/rspec/rails/tasks/rspec.rake",
|
86
|
-
"lib/rspec/rails/transactional_database_support.rb",
|
87
87
|
"lib/rspec/rails/version.rb",
|
88
88
|
"lib/rspec/rails/view_assigns.rb",
|
89
89
|
"lib/rspec/rails/view_rendering.rb",
|
@@ -101,7 +101,6 @@ Gem::Specification.new do |s|
|
|
101
101
|
"spec/rspec/rails/mocks/ar_classes.rb",
|
102
102
|
"spec/rspec/rails/mocks/mock_model_spec.rb",
|
103
103
|
"spec/rspec/rails/mocks/stub_model_spec.rb",
|
104
|
-
"spec/rspec/rails/transactional_database_support_spec.rb",
|
105
104
|
"spec/spec_helper.rb",
|
106
105
|
"spec/support/helpers.rb",
|
107
106
|
"specs.watchr",
|
@@ -111,7 +110,7 @@ Gem::Specification.new do |s|
|
|
111
110
|
s.homepage = %q{http://github.com/rspec/rspec-rails}
|
112
111
|
s.post_install_message = %q{**************************************************
|
113
112
|
|
114
|
-
Thank you for installing rspec-rails-2.0.0.beta.
|
113
|
+
Thank you for installing rspec-rails-2.0.0.beta.10!
|
115
114
|
|
116
115
|
This version of rspec-rails only works with
|
117
116
|
versions of rails >= 3.0.0.pre.
|
@@ -126,7 +125,7 @@ Gem::Specification.new do |s|
|
|
126
125
|
s.require_paths = ["lib"]
|
127
126
|
s.rubyforge_project = %q{rspec}
|
128
127
|
s.rubygems_version = %q{1.3.6}
|
129
|
-
s.summary = %q{rspec-rails-2.0.0.beta.
|
128
|
+
s.summary = %q{rspec-rails-2.0.0.beta.10}
|
130
129
|
s.test_files = [
|
131
130
|
"spec/rspec/rails/example/controller_example_group_spec.rb",
|
132
131
|
"spec/rspec/rails/example/helper_example_group_spec.rb",
|
@@ -141,7 +140,6 @@ Gem::Specification.new do |s|
|
|
141
140
|
"spec/rspec/rails/mocks/ar_classes.rb",
|
142
141
|
"spec/rspec/rails/mocks/mock_model_spec.rb",
|
143
142
|
"spec/rspec/rails/mocks/stub_model_spec.rb",
|
144
|
-
"spec/rspec/rails/transactional_database_support_spec.rb",
|
145
143
|
"spec/spec_helper.rb",
|
146
144
|
"spec/support/helpers.rb"
|
147
145
|
]
|
@@ -151,14 +149,14 @@ Gem::Specification.new do |s|
|
|
151
149
|
s.specification_version = 3
|
152
150
|
|
153
151
|
if Gem::Version.new(Gem::RubyGemsVersion) >= Gem::Version.new('1.2.0') then
|
154
|
-
s.add_runtime_dependency(%q<rspec>, ["= 2.0.0.beta.
|
152
|
+
s.add_runtime_dependency(%q<rspec>, ["= 2.0.0.beta.10"])
|
155
153
|
s.add_runtime_dependency(%q<webrat>, [">= 0.7.0"])
|
156
154
|
else
|
157
|
-
s.add_dependency(%q<rspec>, ["= 2.0.0.beta.
|
155
|
+
s.add_dependency(%q<rspec>, ["= 2.0.0.beta.10"])
|
158
156
|
s.add_dependency(%q<webrat>, [">= 0.7.0"])
|
159
157
|
end
|
160
158
|
else
|
161
|
-
s.add_dependency(%q<rspec>, ["= 2.0.0.beta.
|
159
|
+
s.add_dependency(%q<rspec>, ["= 2.0.0.beta.10"])
|
162
160
|
s.add_dependency(%q<webrat>, [">= 0.7.0"])
|
163
161
|
end
|
164
162
|
end
|
@@ -1,11 +1,13 @@
|
|
1
1
|
require "spec_helper"
|
2
2
|
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
3
|
+
module RSpec::Rails
|
4
|
+
describe ControllerExampleGroup do
|
5
|
+
it "is included in specs in ./spec/controllers" do
|
6
|
+
stub_metadata(
|
7
|
+
:example_group => {:file_path => "./spec/controllers/whatever_spec.rb:15"}
|
8
|
+
)
|
9
|
+
group = RSpec::Core::ExampleGroup.describe
|
10
|
+
group.included_modules.should include(ControllerExampleGroup)
|
11
|
+
end
|
10
12
|
end
|
11
13
|
end
|
@@ -1,20 +1,22 @@
|
|
1
1
|
require "spec_helper"
|
2
2
|
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
3
|
+
module RSpec::Rails
|
4
|
+
describe HelperExampleGroup do
|
5
|
+
it "is included in specs in ./spec/views" do
|
6
|
+
stub_metadata(
|
7
|
+
:example_group => {:file_path => "./spec/helpers/whatever_spec.rb:15"}
|
8
|
+
)
|
9
|
+
group = RSpec::Core::ExampleGroup.describe
|
10
|
+
group.included_modules.should include(HelperExampleGroup)
|
11
|
+
end
|
11
12
|
|
12
|
-
|
13
|
+
module ::FoosHelper; end
|
13
14
|
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
15
|
+
it "provides a controller_path based on the helper module's name" do
|
16
|
+
helper_spec = Object.new
|
17
|
+
helper_spec.extend HelperExampleGroup::InstanceMethods
|
18
|
+
helper_spec.stub_chain(:running_example, :example_group, :describes).and_return(FoosHelper)
|
19
|
+
helper_spec.__send__(:_controller_path).should == "foos"
|
20
|
+
end
|
19
21
|
end
|
20
22
|
end
|
@@ -1,11 +1,13 @@
|
|
1
1
|
require "spec_helper"
|
2
2
|
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
3
|
+
module RSpec::Rails
|
4
|
+
describe MailerExampleGroup do
|
5
|
+
it "is included in specs in ./spec/mailers" do
|
6
|
+
stub_metadata(
|
7
|
+
:example_group => {:file_path => "./spec/mailers/whatever_spec.rb:15"}
|
8
|
+
)
|
9
|
+
group = RSpec::Core::ExampleGroup.describe
|
10
|
+
group.included_modules.should include(MailerExampleGroup)
|
11
|
+
end
|
10
12
|
end
|
11
13
|
end
|
@@ -1,11 +1,13 @@
|
|
1
1
|
require "spec_helper"
|
2
2
|
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
3
|
+
module RSpec::Rails
|
4
|
+
describe RequestExampleGroup do
|
5
|
+
it "is included in specs in ./spec/requests" do
|
6
|
+
stub_metadata(
|
7
|
+
:example_group => {:file_path => "./spec/requests/whatever_spec.rb:15"}
|
8
|
+
)
|
9
|
+
group = RSpec::Core::ExampleGroup.describe
|
10
|
+
group.included_modules.should include(RequestExampleGroup)
|
11
|
+
end
|
10
12
|
end
|
11
13
|
end
|
@@ -1,74 +1,76 @@
|
|
1
1
|
require "spec_helper"
|
2
2
|
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
3
|
+
module RSpec::Rails
|
4
|
+
describe ViewExampleGroup do
|
5
|
+
it "is included in specs in ./spec/views" do
|
6
|
+
stub_metadata(
|
7
|
+
:example_group => {:file_path => "./spec/views/whatever_spec.rb:15"}
|
8
|
+
)
|
9
|
+
group = RSpec::Core::ExampleGroup.describe
|
10
|
+
group.included_modules.should include(ViewExampleGroup)
|
11
|
+
end
|
11
12
|
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
13
|
+
describe "#render" do
|
14
|
+
let(:view_spec) do
|
15
|
+
Class.new do
|
16
|
+
module Local
|
17
|
+
def received
|
18
|
+
@received ||= []
|
19
|
+
end
|
20
|
+
def render(options={}, local_assigns={}, &block)
|
21
|
+
received << [options, local_assigns, block]
|
22
|
+
end
|
21
23
|
end
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
end
|
26
|
-
end
|
24
|
+
include Local
|
25
|
+
include ViewExampleGroup::InstanceMethods
|
26
|
+
end.new
|
27
|
+
end
|
27
28
|
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
29
|
+
context "given no input" do
|
30
|
+
it "sends render(:file => (described file)) to the view" do
|
31
|
+
view_spec.stub(:_default_file_to_render) { "widgets/new.html.erb" }
|
32
|
+
view_spec.render
|
33
|
+
view_spec.received.first.should == [{:template => "widgets/new.html.erb"},{}, nil]
|
34
|
+
end
|
33
35
|
end
|
34
|
-
end
|
35
36
|
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
37
|
+
context "given a string" do
|
38
|
+
it "sends string as the first arg to render" do
|
39
|
+
view_spec.render('arbitrary/path')
|
40
|
+
view_spec.received.first.should == ["arbitrary/path", {}, nil]
|
41
|
+
end
|
40
42
|
end
|
41
|
-
end
|
42
43
|
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
44
|
+
context "given a hash" do
|
45
|
+
it "sends the hash as the first arg to render" do
|
46
|
+
view_spec.render(:foo => 'bar')
|
47
|
+
view_spec.received.first.should == [{:foo => "bar"}, {}, nil]
|
48
|
+
end
|
47
49
|
end
|
48
50
|
end
|
49
|
-
end
|
50
51
|
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
52
|
+
describe "#_controller_path" do
|
53
|
+
let(:view_spec) do
|
54
|
+
Class.new do
|
55
|
+
include ViewExampleGroup::InstanceMethods
|
56
|
+
end.new
|
57
|
+
end
|
58
|
+
context "with a common _default_file_to_render" do
|
59
|
+
it "it returns the directory" do
|
60
|
+
view_spec.stub(:_default_file_to_render).
|
61
|
+
and_return("things/new.html.erb")
|
62
|
+
view_spec.__send__(:_controller_path).
|
63
|
+
should == "things"
|
64
|
+
end
|
63
65
|
end
|
64
|
-
end
|
65
66
|
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
-
|
70
|
-
|
71
|
-
|
67
|
+
context "with a nested _default_file_to_render" do
|
68
|
+
it "it returns the directory path" do
|
69
|
+
view_spec.stub(:_default_file_to_render).
|
70
|
+
and_return("admin/things/new.html.erb")
|
71
|
+
view_spec.__send__(:_controller_path).
|
72
|
+
should == "admin/things"
|
73
|
+
end
|
72
74
|
end
|
73
75
|
end
|
74
76
|
end
|
@@ -1,68 +1,69 @@
|
|
1
1
|
require "spec_helper"
|
2
2
|
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
it("does something") {}
|
10
|
-
end
|
11
|
-
group.run(double.as_null_object)
|
12
|
-
rendering_views.should be_false
|
13
|
-
end
|
14
|
-
|
15
|
-
it "doesn't render views by default in a nested group" do
|
16
|
-
rendering_views = nil
|
17
|
-
group = RSpec::Core::ExampleGroup.describe do
|
18
|
-
include ControllerExampleGroupBehaviour
|
19
|
-
describe "nested" do
|
3
|
+
module RSpec::Rails
|
4
|
+
describe ViewRendering do
|
5
|
+
it "doesn't render views by default" do
|
6
|
+
rendering_views = nil
|
7
|
+
group = RSpec::Core::ExampleGroup.describe do
|
8
|
+
include ControllerExampleGroup
|
20
9
|
rendering_views = render_views?
|
21
10
|
it("does something") {}
|
22
11
|
end
|
12
|
+
group.run(double.as_null_object)
|
13
|
+
rendering_views.should be_false
|
23
14
|
end
|
24
|
-
group.run(double.as_null_object)
|
25
|
-
rendering_views.should be_false
|
26
|
-
end
|
27
15
|
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
16
|
+
it "doesn't render views by default in a nested group" do
|
17
|
+
rendering_views = nil
|
18
|
+
group = RSpec::Core::ExampleGroup.describe do
|
19
|
+
include ControllerExampleGroup
|
20
|
+
describe "nested" do
|
21
|
+
rendering_views = render_views?
|
22
|
+
it("does something") {}
|
23
|
+
end
|
24
|
+
end
|
25
|
+
group.run(double.as_null_object)
|
26
|
+
rendering_views.should be_false
|
35
27
|
end
|
36
|
-
group.run(double.as_null_object)
|
37
|
-
rendering_views.should be_true
|
38
|
-
end
|
39
28
|
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
describe "nested" do
|
29
|
+
it "renders views if told to" do
|
30
|
+
rendering_views = false
|
31
|
+
group = RSpec::Core::ExampleGroup.describe do
|
32
|
+
include ControllerExampleGroup
|
45
33
|
render_views
|
46
34
|
rendering_views = render_views?
|
47
35
|
it("does something") {}
|
48
36
|
end
|
37
|
+
group.run(double.as_null_object)
|
38
|
+
rendering_views.should be_true
|
49
39
|
end
|
50
|
-
group.run(double.as_null_object)
|
51
|
-
rendering_views.should be_true
|
52
|
-
end
|
53
40
|
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
41
|
+
it "renders views if told to in a nested group" do
|
42
|
+
rendering_views = nil
|
43
|
+
group = RSpec::Core::ExampleGroup.describe do
|
44
|
+
include ControllerExampleGroup
|
45
|
+
describe "nested" do
|
46
|
+
render_views
|
47
|
+
rendering_views = render_views?
|
48
|
+
it("does something") {}
|
49
|
+
end
|
62
50
|
end
|
51
|
+
group.run(double.as_null_object)
|
52
|
+
rendering_views.should be_true
|
53
|
+
end
|
54
|
+
|
55
|
+
it "renders views in a nested group if told to in an outer group" do
|
56
|
+
rendering_views = nil
|
57
|
+
group = RSpec::Core::ExampleGroup.describe do
|
58
|
+
include ControllerExampleGroup
|
59
|
+
render_views
|
60
|
+
describe "nested" do
|
61
|
+
rendering_views = render_views?
|
62
|
+
it("does something") {}
|
63
|
+
end
|
64
|
+
end
|
65
|
+
group.run(double.as_null_object)
|
66
|
+
rendering_views.should be_true
|
63
67
|
end
|
64
|
-
group.run(double.as_null_object)
|
65
|
-
rendering_views.should be_true
|
66
68
|
end
|
67
69
|
end
|
68
|
-
|
metadata
CHANGED
@@ -7,9 +7,8 @@ version: !ruby/object:Gem::Version
|
|
7
7
|
- 0
|
8
8
|
- 0
|
9
9
|
- beta
|
10
|
-
-
|
11
|
-
|
12
|
-
version: 2.0.0.beta.9.1
|
10
|
+
- 10
|
11
|
+
version: 2.0.0.beta.10
|
13
12
|
platform: ruby
|
14
13
|
authors:
|
15
14
|
- David Chelimsky
|
@@ -18,7 +17,7 @@ autorequire:
|
|
18
17
|
bindir: bin
|
19
18
|
cert_chain: []
|
20
19
|
|
21
|
-
date: 2010-
|
20
|
+
date: 2010-06-02 00:00:00 -05:00
|
22
21
|
default_executable:
|
23
22
|
dependencies:
|
24
23
|
- !ruby/object:Gem::Dependency
|
@@ -33,8 +32,8 @@ dependencies:
|
|
33
32
|
- 0
|
34
33
|
- 0
|
35
34
|
- beta
|
36
|
-
-
|
37
|
-
version: 2.0.0.beta.
|
35
|
+
- 10
|
36
|
+
version: 2.0.0.beta.10
|
38
37
|
type: :runtime
|
39
38
|
version_requirements: *id001
|
40
39
|
- !ruby/object:Gem::Dependency
|
@@ -87,7 +86,7 @@ files:
|
|
87
86
|
- lib/generators/rspec/helper/templates/helper_spec.rb
|
88
87
|
- lib/generators/rspec/install/install_generator.rb
|
89
88
|
- lib/generators/rspec/install/templates/autotest/discover.rb
|
90
|
-
- lib/generators/rspec/install/templates/
|
89
|
+
- lib/generators/rspec/install/templates/lib/tasks/rspec.rake
|
91
90
|
- lib/generators/rspec/install/templates/spec/spec_helper.rb
|
92
91
|
- lib/generators/rspec/integration/integration_generator.rb
|
93
92
|
- lib/generators/rspec/integration/templates/request_spec.rb
|
@@ -111,6 +110,7 @@ files:
|
|
111
110
|
- lib/rspec-rails.rb
|
112
111
|
- lib/rspec/rails.rb
|
113
112
|
- lib/rspec/rails/adapters.rb
|
113
|
+
- lib/rspec/rails/configuration.rb
|
114
114
|
- lib/rspec/rails/example.rb
|
115
115
|
- lib/rspec/rails/example/controller_example_group.rb
|
116
116
|
- lib/rspec/rails/example/helper_example_group.rb
|
@@ -119,6 +119,7 @@ files:
|
|
119
119
|
- lib/rspec/rails/example/view_example_group.rb
|
120
120
|
- lib/rspec/rails/extensions.rb
|
121
121
|
- lib/rspec/rails/extensions/active_record/base.rb
|
122
|
+
- lib/rspec/rails/fixture_support.rb
|
122
123
|
- lib/rspec/rails/matchers.rb
|
123
124
|
- lib/rspec/rails/mocks.rb
|
124
125
|
- lib/rspec/rails/monkey.rb
|
@@ -126,8 +127,6 @@ files:
|
|
126
127
|
- lib/rspec/rails/monkey/action_view/test_case.rb
|
127
128
|
- lib/rspec/rails/monkey/active_support/notifications/fanout.rb
|
128
129
|
- lib/rspec/rails/null_resolver.rb
|
129
|
-
- lib/rspec/rails/tasks/rspec.rake
|
130
|
-
- lib/rspec/rails/transactional_database_support.rb
|
131
130
|
- lib/rspec/rails/version.rb
|
132
131
|
- lib/rspec/rails/view_assigns.rb
|
133
132
|
- lib/rspec/rails/view_rendering.rb
|
@@ -145,7 +144,6 @@ files:
|
|
145
144
|
- spec/rspec/rails/mocks/ar_classes.rb
|
146
145
|
- spec/rspec/rails/mocks/mock_model_spec.rb
|
147
146
|
- spec/rspec/rails/mocks/stub_model_spec.rb
|
148
|
-
- spec/rspec/rails/transactional_database_support_spec.rb
|
149
147
|
- spec/spec_helper.rb
|
150
148
|
- spec/support/helpers.rb
|
151
149
|
- specs.watchr
|
@@ -158,7 +156,7 @@ licenses: []
|
|
158
156
|
post_install_message: |
|
159
157
|
**************************************************
|
160
158
|
|
161
|
-
Thank you for installing rspec-rails-2.0.0.beta.
|
159
|
+
Thank you for installing rspec-rails-2.0.0.beta.10!
|
162
160
|
|
163
161
|
This version of rspec-rails only works with
|
164
162
|
versions of rails >= 3.0.0.pre.
|
@@ -195,7 +193,7 @@ rubyforge_project: rspec
|
|
195
193
|
rubygems_version: 1.3.6
|
196
194
|
signing_key:
|
197
195
|
specification_version: 3
|
198
|
-
summary: rspec-rails-2.0.0.beta.
|
196
|
+
summary: rspec-rails-2.0.0.beta.10
|
199
197
|
test_files:
|
200
198
|
- spec/rspec/rails/example/controller_example_group_spec.rb
|
201
199
|
- spec/rspec/rails/example/helper_example_group_spec.rb
|
@@ -210,6 +208,5 @@ test_files:
|
|
210
208
|
- spec/rspec/rails/mocks/ar_classes.rb
|
211
209
|
- spec/rspec/rails/mocks/mock_model_spec.rb
|
212
210
|
- spec/rspec/rails/mocks/stub_model_spec.rb
|
213
|
-
- spec/rspec/rails/transactional_database_support_spec.rb
|
214
211
|
- spec/spec_helper.rb
|
215
212
|
- spec/support/helpers.rb
|
@@ -1,40 +0,0 @@
|
|
1
|
-
module RSpec
|
2
|
-
module Rails
|
3
|
-
module TransactionalDatabaseSupport
|
4
|
-
|
5
|
-
def active_record_configured?
|
6
|
-
defined?(::ActiveRecord) && !::ActiveRecord::Base.configurations.blank?
|
7
|
-
end
|
8
|
-
|
9
|
-
def use_transactional_examples?
|
10
|
-
active_record_configured? && RSpec.configuration.use_transactional_examples?
|
11
|
-
end
|
12
|
-
|
13
|
-
def setup_transactional_examples
|
14
|
-
return unless use_transactional_examples?
|
15
|
-
|
16
|
-
::ActiveRecord::Base.connection.increment_open_transactions
|
17
|
-
::ActiveRecord::Base.connection.begin_db_transaction
|
18
|
-
end
|
19
|
-
|
20
|
-
def teardown_transactional_examples
|
21
|
-
return unless use_transactional_examples?
|
22
|
-
|
23
|
-
if ::ActiveRecord::Base.connection.open_transactions != 0
|
24
|
-
::ActiveRecord::Base.connection.rollback_db_transaction
|
25
|
-
::ActiveRecord::Base.connection.decrement_open_transactions
|
26
|
-
end
|
27
|
-
|
28
|
-
::ActiveRecord::Base.clear_active_connections!
|
29
|
-
end
|
30
|
-
|
31
|
-
end
|
32
|
-
end
|
33
|
-
end
|
34
|
-
|
35
|
-
RSpec.configure do |c|
|
36
|
-
c.include RSpec::Rails::TransactionalDatabaseSupport
|
37
|
-
c.before { setup_transactional_examples }
|
38
|
-
c.after { teardown_transactional_examples }
|
39
|
-
end
|
40
|
-
|
@@ -1,54 +0,0 @@
|
|
1
|
-
require 'spec_helper'
|
2
|
-
|
3
|
-
describe RSpec::Rails::TransactionalDatabaseSupport do
|
4
|
-
|
5
|
-
let(:connection) { double('connection', :open_transactions => 1) }
|
6
|
-
let(:test_bed) do
|
7
|
-
Class.new do
|
8
|
-
include RSpec::Rails::TransactionalDatabaseSupport
|
9
|
-
def active_record_configured?; true; end
|
10
|
-
end.new
|
11
|
-
end
|
12
|
-
|
13
|
-
before { ::ActiveRecord::Base.stub(:connection) { connection } }
|
14
|
-
|
15
|
-
describe "#setup_transactional_examples" do
|
16
|
-
context 'when running with examples with transactions' do
|
17
|
-
it "opens a new transaction" do
|
18
|
-
test_bed.stub(:use_transactional_examples?) { true }
|
19
|
-
connection.should_receive(:increment_open_transactions)
|
20
|
-
connection.should_receive(:begin_db_transaction)
|
21
|
-
test_bed.setup_transactional_examples
|
22
|
-
end
|
23
|
-
end
|
24
|
-
|
25
|
-
context 'with transactionless examples' do
|
26
|
-
it "doesn't open a transaction" do
|
27
|
-
test_bed.stub(:use_transactional_examples?) { false }
|
28
|
-
connection.should_not_receive(:increment_open_transactions)
|
29
|
-
connection.should_not_receive(:begin_db_transaction)
|
30
|
-
test_bed.setup_transactional_examples
|
31
|
-
end
|
32
|
-
end
|
33
|
-
end
|
34
|
-
|
35
|
-
describe "#teardown_transactional_examples" do
|
36
|
-
context 'when running with examples with transactions' do
|
37
|
-
it "opens a new transaction" do
|
38
|
-
test_bed.stub(:use_transactional_examples?) { true }
|
39
|
-
connection.should_receive(:rollback_db_transaction)
|
40
|
-
connection.should_receive(:decrement_open_transactions)
|
41
|
-
test_bed.teardown_transactional_examples
|
42
|
-
end
|
43
|
-
end
|
44
|
-
|
45
|
-
context 'with transactionless examples' do
|
46
|
-
it "doesn't close an open transaction" do
|
47
|
-
test_bed.stub(:use_transactional_examples?) { false }
|
48
|
-
connection.should_not_receive(:decrement_open_transactions)
|
49
|
-
connection.should_not_receive(:rollback_db_transaction)
|
50
|
-
test_bed.teardown_transactional_examples
|
51
|
-
end
|
52
|
-
end
|
53
|
-
end
|
54
|
-
end
|