capybara-rails 0.0.1 → 0.0.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/capybara-rails.gemspec +1 -0
- data/lib/capybara-rails/action_dispatch_integration.rb +26 -0
- data/lib/capybara-rails/activerecord.rb +4 -11
- data/lib/capybara-rails/railtie.rb +11 -0
- data/lib/capybara-rails/version.rb +1 -1
- metadata +17 -3
- data/lib/capybara-rails/minitest.rb +0 -18
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: bf0b5fc2e26c3956c33e5e1e55af16994d665807
|
4
|
+
data.tar.gz: 7b73f197dbdd21be9dae6821e25e99e7e85302c7
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 2b1a2e7c64509009dd26945d028dc8700bbdff0ac543afb855475b41c6659871ab64d870ac4eb89403181978ed6c4c88ea00c5854717d6a179d1c232999e0bec
|
7
|
+
data.tar.gz: 5603a8ea66a2715ea654aae23ec509e7c385079270ef34400e1f428e633cec060900504b3b12c6c8b583a022ac6f0bd1ff1d78ed4666adbcb9a052ca6d597605
|
data/capybara-rails.gemspec
CHANGED
@@ -0,0 +1,26 @@
|
|
1
|
+
class ActionDispatch::IntegrationTest
|
2
|
+
include Capybara::DSL
|
3
|
+
|
4
|
+
if defined?(ActiveRecord::Base)
|
5
|
+
setup do
|
6
|
+
ActiveRecord::Base.shared_connection = ActiveRecord::Base.connection
|
7
|
+
ActiveRecord::Base.descendants.each do |model|
|
8
|
+
model.shared_connection = model.connection
|
9
|
+
end
|
10
|
+
DatabaseCleaner.start
|
11
|
+
end
|
12
|
+
|
13
|
+
teardown do
|
14
|
+
DatabaseCleaner.clean
|
15
|
+
end
|
16
|
+
end
|
17
|
+
|
18
|
+
def saop
|
19
|
+
save_and_open_page
|
20
|
+
end
|
21
|
+
|
22
|
+
def assert_response(type)
|
23
|
+
result = page.status_code == Rack::Utils::SYMBOL_TO_STATUS_CODE[type]
|
24
|
+
assert result, ("Expected response to be a %s, but was %s" % [type, page.status_code])
|
25
|
+
end
|
26
|
+
end
|
@@ -1,14 +1,7 @@
|
|
1
|
-
|
2
|
-
|
3
|
-
module Rails
|
4
|
-
class ActiveRecord::Base
|
5
|
-
mattr_accessor :shared_connection
|
6
|
-
@@shared_connection = nil
|
1
|
+
class ActiveRecord::Base
|
2
|
+
class_attribute :shared_connection
|
7
3
|
|
8
|
-
|
9
|
-
|
10
|
-
end
|
11
|
-
end
|
12
|
-
ActiveRecord::Base.shared_connection = ActiveRecord::Base.connection
|
4
|
+
def self.connection
|
5
|
+
self.shared_connection || retrieve_connection
|
13
6
|
end
|
14
7
|
end
|
@@ -7,6 +7,17 @@ module Capybara
|
|
7
7
|
end
|
8
8
|
|
9
9
|
require 'capybara/rails'
|
10
|
+
|
11
|
+
if defined?(ActiveRecord::Base)
|
12
|
+
require 'capybara-rails/activerecord'
|
13
|
+
require 'database_cleaner'
|
14
|
+
DatabaseCleaner.strategy = :transaction
|
15
|
+
end
|
16
|
+
|
17
|
+
if defined?(ActionDispatch::Integration)
|
18
|
+
require 'capybara-rails/action_dispatch_integration'
|
19
|
+
end
|
20
|
+
|
10
21
|
require 'exception_notification'
|
11
22
|
|
12
23
|
exception_logger = Logger.new('log/capybara_exceptions.log')
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: capybara-rails
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Kirill Mokevnin
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2013-10-
|
11
|
+
date: 2013-10-18 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -80,6 +80,20 @@ dependencies:
|
|
80
80
|
- - '>='
|
81
81
|
- !ruby/object:Gem::Version
|
82
82
|
version: '0'
|
83
|
+
- !ruby/object:Gem::Dependency
|
84
|
+
name: database_cleaner
|
85
|
+
requirement: !ruby/object:Gem::Requirement
|
86
|
+
requirements:
|
87
|
+
- - '>='
|
88
|
+
- !ruby/object:Gem::Version
|
89
|
+
version: '0'
|
90
|
+
type: :runtime
|
91
|
+
prerelease: false
|
92
|
+
version_requirements: !ruby/object:Gem::Requirement
|
93
|
+
requirements:
|
94
|
+
- - '>='
|
95
|
+
- !ruby/object:Gem::Version
|
96
|
+
version: '0'
|
83
97
|
description: capybara for rails
|
84
98
|
email:
|
85
99
|
- mokevnin@gmail.com
|
@@ -94,8 +108,8 @@ files:
|
|
94
108
|
- Rakefile
|
95
109
|
- capybara-rails.gemspec
|
96
110
|
- lib/capybara-rails.rb
|
111
|
+
- lib/capybara-rails/action_dispatch_integration.rb
|
97
112
|
- lib/capybara-rails/activerecord.rb
|
98
|
-
- lib/capybara-rails/minitest.rb
|
99
113
|
- lib/capybara-rails/railtie.rb
|
100
114
|
- lib/capybara-rails/version.rb
|
101
115
|
homepage: ''
|
@@ -1,18 +0,0 @@
|
|
1
|
-
module Capybara
|
2
|
-
module Rails
|
3
|
-
module Minitest
|
4
|
-
ActionDispatch::IntegrationTest.class_eval do
|
5
|
-
include Capybara::DSL
|
6
|
-
|
7
|
-
def saop
|
8
|
-
save_and_open_page
|
9
|
-
end
|
10
|
-
|
11
|
-
def assert_response(type)
|
12
|
-
result = page.status_code == Rack::Utils::SYMBOL_TO_STATUS_CODE[type]
|
13
|
-
assert result, ("Expected response to be a %s, but was %s" % [type, page.status_code])
|
14
|
-
end
|
15
|
-
end
|
16
|
-
end
|
17
|
-
end
|
18
|
-
end
|