Skip to content

Commit 7a8544e

Browse files
committed
First commit.
0 parents  commit 7a8544e

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

71 files changed

+1636
-0
lines changed

.gitignore

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
.bundle/
2+
log/*.log
3+
pkg/
4+
test/dummy/db/*.sqlite3
5+
test/dummy/db/*.sqlite3-journal
6+
test/dummy/log/*.log
7+
test/dummy/tmp/
8+
test/dummy/.sass-cache

Gemfile

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
source 'https://rubygems.org'
2+
gemspec

Gemfile.lock

Lines changed: 106 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,106 @@
1+
PATH
2+
remote: .
3+
specs:
4+
rails-controller-testing (0.0.1)
5+
rails (~> 4.2.1)
6+
7+
GEM
8+
remote: https://rubygems.org/
9+
specs:
10+
actionmailer (4.2.1)
11+
actionpack (= 4.2.1)
12+
actionview (= 4.2.1)
13+
activejob (= 4.2.1)
14+
mail (~> 2.5, >= 2.5.4)
15+
rails-dom-testing (~> 1.0, >= 1.0.5)
16+
actionpack (4.2.1)
17+
actionview (= 4.2.1)
18+
activesupport (= 4.2.1)
19+
rack (~> 1.6)
20+
rack-test (~> 0.6.2)
21+
rails-dom-testing (~> 1.0, >= 1.0.5)
22+
rails-html-sanitizer (~> 1.0, >= 1.0.1)
23+
actionview (4.2.1)
24+
activesupport (= 4.2.1)
25+
builder (~> 3.1)
26+
erubis (~> 2.7.0)
27+
rails-dom-testing (~> 1.0, >= 1.0.5)
28+
rails-html-sanitizer (~> 1.0, >= 1.0.1)
29+
activejob (4.2.1)
30+
activesupport (= 4.2.1)
31+
globalid (>= 0.3.0)
32+
activemodel (4.2.1)
33+
activesupport (= 4.2.1)
34+
builder (~> 3.1)
35+
activerecord (4.2.1)
36+
activemodel (= 4.2.1)
37+
activesupport (= 4.2.1)
38+
arel (~> 6.0)
39+
activesupport (4.2.1)
40+
i18n (~> 0.7)
41+
json (~> 1.7, >= 1.7.7)
42+
minitest (~> 5.1)
43+
thread_safe (~> 0.3, >= 0.3.4)
44+
tzinfo (~> 1.1)
45+
arel (6.0.0)
46+
builder (3.2.2)
47+
erubis (2.7.0)
48+
globalid (0.3.5)
49+
activesupport (>= 4.1.0)
50+
i18n (0.7.0)
51+
json (1.8.2)
52+
loofah (2.0.2)
53+
nokogiri (>= 1.5.9)
54+
mail (2.6.3)
55+
mime-types (>= 1.16, < 3)
56+
mime-types (2.5)
57+
mini_portile (0.6.2)
58+
minitest (5.6.1)
59+
nokogiri (1.6.6.2)
60+
mini_portile (~> 0.6.0)
61+
rack (1.6.1)
62+
rack-test (0.6.3)
63+
rack (>= 1.0)
64+
rails (4.2.1)
65+
actionmailer (= 4.2.1)
66+
actionpack (= 4.2.1)
67+
actionview (= 4.2.1)
68+
activejob (= 4.2.1)
69+
activemodel (= 4.2.1)
70+
activerecord (= 4.2.1)
71+
activesupport (= 4.2.1)
72+
bundler (>= 1.3.0, < 2.0)
73+
railties (= 4.2.1)
74+
sprockets-rails
75+
rails-deprecated_sanitizer (1.0.3)
76+
activesupport (>= 4.2.0.alpha)
77+
rails-dom-testing (1.0.6)
78+
activesupport (>= 4.2.0.beta, < 5.0)
79+
nokogiri (~> 1.6.0)
80+
rails-deprecated_sanitizer (>= 1.0.1)
81+
rails-html-sanitizer (1.0.2)
82+
loofah (~> 2.0)
83+
railties (4.2.1)
84+
actionpack (= 4.2.1)
85+
activesupport (= 4.2.1)
86+
rake (>= 0.8.7)
87+
thor (>= 0.18.1, < 2.0)
88+
rake (10.4.2)
89+
sprockets (3.1.0)
90+
rack (~> 1.0)
91+
sprockets-rails (2.3.1)
92+
actionpack (>= 3.0)
93+
activesupport (>= 3.0)
94+
sprockets (>= 2.8, < 4.0)
95+
sqlite3 (1.3.10)
96+
thor (0.19.1)
97+
thread_safe (0.3.5)
98+
tzinfo (1.2.2)
99+
thread_safe (~> 0.1)
100+
101+
PLATFORMS
102+
ruby
103+
104+
DEPENDENCIES
105+
rails-controller-testing!
106+
sqlite3

LICENSE

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
Copyright 2015 Alan Guo Xiang Tan
2+
3+
Permission is hereby granted, free of charge, to any person obtaining
4+
a copy of this software and associated documentation files (the
5+
"Software"), to deal in the Software without restriction, including
6+
without limitation the rights to use, copy, modify, merge, publish,
7+
distribute, sublicense, and/or sell copies of the Software, and to
8+
permit persons to whom the Software is furnished to do so, subject to
9+
the following conditions:
10+
11+
The above copyright notice and this permission notice shall be
12+
included in all copies or substantial portions of the Software.
13+
14+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
15+
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
16+
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
17+
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
18+
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
19+
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
20+
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

README.md

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
# Rails::Controller::Testing
2+
3+
TODO
4+
5+
## Installation
6+
7+
Add this line to your application's Gemfile:
8+
9+
gem 'rails-dom-testing'
10+
11+
And then execute:
12+
13+
$ bundle
14+
15+
Or install it yourself as:
16+
17+
$ gem install rails-dom-testing
18+
19+
## Usage
20+
21+
TODO
22+
23+
## Contributing
24+
25+
1. Fork it
26+
2. Create your feature branch (`git checkout -b my-new-feature`)
27+
3. Commit your changes (`git commit -am 'Add some feature'`)
28+
4. Push to the branch (`git push origin my-new-feature`)
29+
5. Create new Pull Request

Rakefile

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
begin
2+
require 'bundler/setup'
3+
rescue LoadError
4+
puts 'You must `gem install bundler` and `bundle install` to run rake tasks'
5+
end
6+
7+
Bundler::GemHelper.install_tasks
8+
9+
require 'rake/testtask'
10+
11+
Rake::TestTask.new(:test) do |t|
12+
t.libs << 'lib'
13+
t.libs << 'test'
14+
t.pattern = 'test/**/*_test.rb'
15+
t.verbose = false
16+
end
17+
18+
task default: :test

lib/rails-controller-testing.rb

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
module Rails
2+
module Controller
3+
module Testing
4+
autoload :TemplateAssertions, 'rails/controller/testing/template_assertions'
5+
autoload :Integration, 'rails/controller/testing/integration'
6+
autoload :TestProcess, 'rails/controller/testing/test_process'
7+
8+
extend ActiveSupport::Concern
9+
10+
include TemplateAssertions
11+
include Integration
12+
include TestProcess
13+
end
14+
end
15+
end
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
module Rails
2+
module Controller
3+
module Testing
4+
module Integration
5+
%w(
6+
get post patch put head delete xml_http_request
7+
xhr get_via_redirect post_via_redirect
8+
).each do |method|
9+
10+
define_method(method) do |*args|
11+
reset_template_assertion
12+
super(*args)
13+
end
14+
end
15+
end
16+
end
17+
end
18+
end

0 commit comments

Comments
 (0)