diff options
author | Eugen Rochko <eugen@zeonfederated.com> | 2019-03-12 17:34:00 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-03-12 17:34:00 +0100 |
commit | 65fffeac3f960f9c74d693525a73ac14b201bf2b (patch) | |
tree | 41d5eaa2a446e161dc26d39960cde870135ee06f /spec | |
parent | 6a8dc59eb8187b49aa3cbf3e4bf80565d8aa15d3 (diff) |
Redesign landing page (#10232)
Diffstat (limited to 'spec')
-rw-r--r-- | spec/requests/localization_spec.rb | 9 | ||||
-rw-r--r-- | spec/views/about/show.html.haml_spec.rb | 34 |
2 files changed, 26 insertions, 17 deletions
diff --git a/spec/requests/localization_spec.rb b/spec/requests/localization_spec.rb index f625a93a4..496a885e8 100644 --- a/spec/requests/localization_spec.rb +++ b/spec/requests/localization_spec.rb @@ -11,8 +11,9 @@ describe 'Localization' do headers = { 'Accept-Language' => 'zh-HK' } get "/about", headers: headers + expect(response.body).to include( - I18n.t('about.about_mastodon_html', locale: 'zh-HK') + I18n.t('about.tagline', locale: 'zh-HK') ) end @@ -20,16 +21,18 @@ describe 'Localization' do headers = { 'Accept-Language' => 'es-FAKE' } get "/about", headers: headers + expect(response.body).to include( - I18n.t('about.about_mastodon_html', locale: 'es') + I18n.t('about.tagline', locale: 'es') ) end it 'falls back to english when locale is missing' do headers = { 'Accept-Language' => '12-FAKE' } get "/about", headers: headers + expect(response.body).to include( - I18n.t('about.about_mastodon_html', locale: 'en') + I18n.t('about.tagline', locale: 'en') ) end end diff --git a/spec/views/about/show.html.haml_spec.rb b/spec/views/about/show.html.haml_spec.rb index eb81090b5..c75c28759 100644 --- a/spec/views/about/show.html.haml_spec.rb +++ b/spec/views/about/show.html.haml_spec.rb @@ -6,23 +6,29 @@ describe 'about/show.html.haml', without_verify_partial_doubles: true do before do allow(view).to receive(:site_hostname).and_return('example.com') allow(view).to receive(:site_title).and_return('example site') + allow(view).to receive(:new_user).and_return(User.new) + allow(view).to receive(:use_seamless_external_login?).and_return(false) end it 'has valid open graph tags' do - instance_presenter = double(:instance_presenter, - site_title: 'something', - site_short_description: 'something', - site_description: 'something', - version_number: '1.0', - source_url: 'https://github.com/tootsuite/mastodon', - open_registrations: false, - thumbnail: nil, - hero: nil, - mascot: nil, - user_count: 0, - status_count: 0, - contact_account: nil, - closed_registrations_message: 'yes') + instance_presenter = double( + :instance_presenter, + site_title: 'something', + site_short_description: 'something', + site_description: 'something', + version_number: '1.0', + source_url: 'https://github.com/tootsuite/mastodon', + open_registrations: false, + thumbnail: nil, + hero: nil, + mascot: nil, + user_count: 420, + status_count: 69, + active_user_count: 420, + contact_account: nil, + sample_accounts: [] + ) + assign(:instance_presenter, instance_presenter) render |