Commit 5e2542c4ceb4e09b0cc11f8301c128a0fc1f4aae
1 parent
4cf48c98
Exists in
theme-brasil-digital-from-staging
and in
9 other branches
fixing unit tests
Showing
3 changed files
with
5 additions
and
2 deletions
Show diff stats
lib/noosfero/api/helpers.rb
test/unit/api/articles_test.rb
test/unit/api/test_helper.rb
| ... | ... | @@ -9,7 +9,8 @@ class ActiveSupport::TestCase |
| 9 | 9 | end |
| 10 | 10 | |
| 11 | 11 | def login_api |
| 12 | - @user = User.create!(:login => 'testapi', :password => 'testapi', :password_confirmation => 'testapi', :email => 'test@test.org', :environment => Environment.default) | |
| 12 | + @environment = fast_create(Environment, :is_default => true) | |
| 13 | + @user = User.create!(:login => 'testapi', :password => 'testapi', :password_confirmation => 'testapi', :email => 'test@test.org', :environment => @environment) | |
| 13 | 14 | @user.activate |
| 14 | 15 | @person = @user.person |
| 15 | 16 | |
| ... | ... | @@ -18,7 +19,7 @@ class ActiveSupport::TestCase |
| 18 | 19 | @private_token = json["private_token"] |
| 19 | 20 | @params = {:private_token => @private_token} |
| 20 | 21 | end |
| 21 | - attr_accessor :private_token, :user, :person, :params | |
| 22 | + attr_accessor :private_token, :user, :person, :params, :environment | |
| 22 | 23 | |
| 23 | 24 | private |
| 24 | 25 | ... | ... |