FIX: remote theme record not saved when checking for updates (#8054)

This commit is contained in:
Osama Sayegh
2019-08-30 00:32:54 +03:00
committed by GitHub
parent 1a909c16eb
commit ff8cc244d8
3 changed files with 20 additions and 6 deletions

View File

@ -330,6 +330,22 @@ describe Admin::ThemesController do
expect(theme.theme_translation_overrides.count).to eq(0)
end
it 'checking for updates saves the remote_theme record' do
theme.remote_theme = RemoteTheme.create!(remote_url: "http://discourse.org", remote_version: "a", local_version: "a", commits_behind: 0)
theme.save!
ThemeStore::GitImporter.any_instance.stubs(:import!)
ThemeStore::GitImporter.any_instance.stubs(:commits_since).returns(["b", 1])
put "/admin/themes/#{theme.id}.json", params: {
theme: {
remote_check: true
}
}
theme.reload
expect(theme.remote_theme.remote_version).to eq("b")
expect(theme.remote_theme.commits_behind).to eq(1)
end
it 'can disable component' do
child = Fabricate(:theme, component: true)