Commit 0f2f0af92da00a0867bc2db302ed96bcc252fe02
1 parent
6f5eea6b
Exists in
master
and in
29 other branches
Rails3: Fix Noosfero unit tests
Showing
1 changed file
with
4 additions
and
2 deletions
Show diff stats
test/unit/noosfero_test.rb
... | ... | @@ -31,7 +31,7 @@ class NoosferoTest < ActiveSupport::TestCase |
31 | 31 | end |
32 | 32 | |
33 | 33 | should 'provide url options to identify development environment' do |
34 | - ENV.expects(:[]).with('RAILS_ENV').returns('development') | |
34 | + Rails.expects('env').returns('development') | |
35 | 35 | Noosfero.expects(:development_url_options).returns({ :port => 9999 }) |
36 | 36 | assert_equal({:port => 9999}, Noosfero.url_options) |
37 | 37 | end |
... | ... | @@ -48,7 +48,9 @@ class NoosferoTest < ActiveSupport::TestCase |
48 | 48 | end |
49 | 49 | |
50 | 50 | should "use default hostname of default environment as hostname of Noosfero instance" do |
51 | - Environment.default.domains << Domain.new(:name => 'thisisdefaulthostname.com', :is_default => true) | |
51 | + Environment.default.domains << Domain.new(:name => 'thisisdefaulthostname.com').tap do |d| | |
52 | + d.is_default = true | |
53 | + end | |
52 | 54 | assert_equal 'thisisdefaulthostname.com', Noosfero.default_hostname |
53 | 55 | end |
54 | 56 | ... | ... |