Commit 869128a0faf244dd7366fe0437441dad2f6d8aea
1 parent
ffc26a00
Exists in
master
and in
28 other branches
ActionItem172: adding extra parameters implictly in get and post methods for functional tests
git-svn-id: https://svn.colivre.coop.br/svn/noosfero/trunk@1480 3f533792-8f58-4932-b0fe-aaf55b0a4547
Showing
2 changed files
with
12 additions
and
0 deletions
Show diff stats
lib/noosfero_test.rb
... | ... | @@ -8,5 +8,16 @@ module NoosferoTest |
8 | 8 | super(path, (parameters ? self.class.extra_parameters.merge(parameters) : self.class.extra_parameters), headers) |
9 | 9 | end |
10 | 10 | |
11 | + module ClassMethods | |
12 | + def noosfero_test(parameters) | |
13 | + instance_variable_set('@noosfero_test_extra_parameters', parameters) | |
14 | + def extra_parameters | |
15 | + @noosfero_test_extra_parameters | |
16 | + end | |
17 | + include NoosferoTest | |
18 | + end | |
19 | + end | |
11 | 20 | |
12 | 21 | end |
22 | + | |
23 | +Test::Unit::TestCase.send(:extend, NoosferoTest::ClassMethods) | ... | ... |
test/test_helper.rb
... | ... | @@ -2,6 +2,7 @@ ENV["RAILS_ENV"] = "test" |
2 | 2 | require File.expand_path(File.dirname(__FILE__) + "/../config/environment") |
3 | 3 | require 'test_help' |
4 | 4 | require 'mocha' |
5 | +require 'noosfero_test' | |
5 | 6 | |
6 | 7 | class Test::Unit::TestCase |
7 | 8 | # Transactional fixtures accelerate your tests by wrapping each test method | ... | ... |