mirror of
https://github.com/discourse/discourse.git
synced 2026-08-10 23:59:31 +08:00
Moves the theme component from Discourse Gifs and brings it into core as an upcoming change. This PR also brings gifs under a single provider (Klipy).
31 lines
1.2 KiB
Ruby
Vendored
31 lines
1.2 KiB
Ruby
Vendored
# frozen_string_literal: true
|
|
|
|
RSpec.describe DiscourseGifs do
|
|
describe ".component_installed?" do
|
|
it "returns false when no discourse-gifs theme component exists" do
|
|
expect(described_class.component_installed?).to eq(false)
|
|
end
|
|
|
|
it "returns true when the component is installed via the canonical URL" do
|
|
remote_theme = RemoteTheme.create!(remote_url: "https://github.com/discourse/discourse-gifs")
|
|
Fabricate(:theme, component: true, remote_theme: remote_theme)
|
|
|
|
expect(described_class.component_installed?).to eq(true)
|
|
end
|
|
|
|
it "returns true when the component is installed via the .git URL" do
|
|
remote_theme =
|
|
RemoteTheme.create!(remote_url: "https://github.com/discourse/discourse-gifs.git")
|
|
Fabricate(:theme, component: true, remote_theme: remote_theme)
|
|
|
|
expect(described_class.component_installed?).to eq(true)
|
|
end
|
|
|
|
it "returns false for forks or similarly-named repos that the migration task would not match" do
|
|
remote_theme = RemoteTheme.create!(remote_url: "https://github.com/myorg/discourse-gifs.git")
|
|
Fabricate(:theme, component: true, remote_theme: remote_theme)
|
|
|
|
expect(described_class.component_installed?).to eq(false)
|
|
end
|
|
end
|
|
end
|