FEATURE: display out of date themes on admin dashboard

* FEATURE: disaply out of date themes on admin dashboard

* Update copy
This commit is contained in:
Osama Sayegh
2018-08-03 02:53:48 +03:00
committed by Sam
parent 864e279aaf
commit 880462a41c
6 changed files with 67 additions and 2 deletions

View File

@ -336,4 +336,19 @@ describe AdminDashboardData do
end
end
describe '#out_of_date_themes' do
let(:remote) { RemoteTheme.create!(remote_url: "https://github.com/org/testtheme") }
let!(:theme) { Theme.create!(remote_theme_id: remote.id, name: "Test< Theme", user_id: -1) }
it "outputs correctly formatted html" do
remote.update!(local_version: "old version", remote_version: "new version", commits_behind: 2)
dashboard_data = described_class.new
expect(dashboard_data.out_of_date_themes).to eq(
I18n.t("dashboard.out_of_date_themes") + "<ul><li><a href=\"/admin/customize/themes/#{theme.id}\">Test&lt; Theme</a></li></ul>"
)
remote.update!(local_version: "new version", commits_behind: 0)
expect(dashboard_data.out_of_date_themes).to eq(nil)
end
end
end