0
0
Fork 0
mirror of https://github.com/discourse/discourse.git synced 2026-08-10 23:59:31 +08:00
discourse/spec/lib/discourse_gifs_spec.rb
David Battersby 031e17658c
DEV: move discourse gifs to core (#40162)
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).
2026-06-10 11:35:44 +04:00

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