@@ -15,6 +15,7 @@ class AboutControllerTest < ActionController::TestCase
1515 end
1616
1717 test 'should show correct funder logos in about us and footer' do
18+ plant_space = spaces ( :plants )
1819 funder_setting = [
1920 {
2021 url : 'https://example.org/your-funders-website' ,
@@ -29,9 +30,19 @@ class AboutControllerTest < ActionController::TestCase
2930 url : 'https://example.org/funder-about' ,
3031 logo : 'https://example.org/funder-about/logo.png' ,
3132 only : 'about'
33+ } ,
34+ {
35+ url : 'https://example.org/funder-default-space' ,
36+ logo : 'https://example.org/funder-default-space/logo.png' ,
37+ space : 'default'
38+ } ,
39+ {
40+ url : 'https://example.org/funder-plants-space' ,
41+ logo : 'https://example.org/funder-plants-space/logo.png' ,
42+ space : plant_space . host
3243 }
3344 ]
34-
45+
3546 with_settings ( funders : funder_setting ) do
3647 get :us
3748 assert_select '#funding' do
@@ -41,8 +52,13 @@ class AboutControllerTest < ActionController::TestCase
4152 assert_select 'a[href=?]' , 'https://example.org/funder-about' do
4253 assert_select 'img[src=?]' , 'https://example.org/funder-about/logo.png'
4354 end
55+ assert_select 'a[href=?]' , 'https://example.org/funder-default-space' do
56+ assert_select 'img[src=?]' , 'https://example.org/funder-default-space/logo.png'
57+ end
4458 assert_select 'a[href=?]' , 'https://example.org/funder-footer' , count : 0
59+ assert_select 'a[href=?]' , 'https://example.org/funder-plants-space' , count : 0
4560 assert_select 'img[src=?]' , 'https://example.org/funder-footer/logo.png' , count : 0
61+ assert_select 'img[src=?]' , 'https://example.org/funder-plants-space/logo.png' , count : 0
4662 end
4763
4864 assert_select 'footer' do
@@ -52,8 +68,32 @@ class AboutControllerTest < ActionController::TestCase
5268 assert_select 'a[href=?]' , 'https://example.org/funder-footer' do
5369 assert_select 'img[src=?]' , 'https://example.org/funder-footer/logo.png'
5470 end
71+ assert_select 'a[href=?]' , 'https://example.org/funder-default-space' do
72+ assert_select 'img[src=?]' , 'https://example.org/funder-default-space/logo.png'
73+ end
5574 assert_select 'a[href=?]' , 'https://example.org/funder-about' , count : 0
75+ assert_select 'a[href=?]' , 'https://example.org/funder-plants-space' , count : 0
5676 assert_select 'img[src=?]' , 'https://example.org/funder-about/logo.png' , count : 0
77+ assert_select 'img[src=?]' , 'https://example.org/funder-plants-space/logo.png' , count : 0
78+ end
79+
80+ with_host ( plant_space . host ) do
81+ get :us
82+ assert_select '#funding' do
83+ assert_select 'a[href=?]' , 'https://example.org/your-funders-website'
84+ assert_select 'a[href=?]' , 'https://example.org/funder-plants-space' do
85+ assert_select 'img[src=?]' , 'https://example.org/funder-plants-space/logo.png'
86+ end
87+ assert_select 'a[href=?]' , 'https://example.org/funder-default-space' , count : 0
88+ end
89+
90+ assert_select 'footer' do
91+ assert_select 'a[href=?]' , 'https://example.org/your-funders-website'
92+ assert_select 'a[href=?]' , 'https://example.org/funder-plants-space' do
93+ assert_select 'img[src=?]' , 'https://example.org/funder-plants-space/logo.png'
94+ end
95+ assert_select 'a[href=?]' , 'https://example.org/funder-default-space' , count : 0
96+ end
5797 end
5898 end
5999 end
0 commit comments