Commit 3f055a209006cd5c2d836ab78ef4967d0a2b7415
Committed by
Antonio Terceiro
1 parent
72e95e07
Exists in
master
and in
23 other branches
Environment theme overcome profile theme if it's nil
* Profile theme is nil by default. * Profile#theme was removed. (ActionItem1432)
Showing
4 changed files
with
7 additions
and
14 deletions
Show diff stats
app/helpers/application_helper.rb
app/models/profile.rb
test/unit/application_helper_test.rb
| ... | ... | @@ -555,6 +555,12 @@ class ApplicationHelperTest < Test::Unit::TestCase |
| 555 | 555 | assert_equal 'profile-theme', current_theme |
| 556 | 556 | end |
| 557 | 557 | |
| 558 | + should 'use environment theme if the profile theme is nil' do | |
| 559 | + stubs(:environment).returns(fast_create(Environment, :theme => 'new-theme')) | |
| 560 | + stubs(:profile).returns(fast_create(Profile)) | |
| 561 | + assert_equal environment.theme, current_theme | |
| 562 | + end | |
| 563 | + | |
| 558 | 564 | protected |
| 559 | 565 | |
| 560 | 566 | def url_for(args = {}) | ... | ... |
test/unit/profile_test.rb
| ... | ... | @@ -909,15 +909,6 @@ class ProfileTest < Test::Unit::TestCase |
| 909 | 909 | assert_equal 'my-shiny-theme', p.theme |
| 910 | 910 | end |
| 911 | 911 | |
| 912 | - should 'delegate theme selection to environment by default' do | |
| 913 | - p = Profile.new | |
| 914 | - env = mock | |
| 915 | - p.stubs(:environment).returns(env) | |
| 916 | - env.expects(:theme).returns('environment-stored-theme') | |
| 917 | - | |
| 918 | - assert_equal 'environment-stored-theme', p.theme | |
| 919 | - end | |
| 920 | - | |
| 921 | 912 | should 'respond to public? as public_profile' do |
| 922 | 913 | p1 = fast_create(Profile) |
| 923 | 914 | p2 = fast_create(Profile, :public_profile => false) | ... | ... |