mirror of
https://github.com/discourse/discourse.git
synced 2025-05-30 07:11:34 +08:00
FEATURE: display commit hash for each plugin on /admin/plugins
page. (#22176)
It will help to find out the current version of the plugins even without the `docker_manager` plugin.
This commit is contained in:
@ -11,4 +11,18 @@ RSpec.describe AdminPluginSerializer do
|
||||
expect(subject.enabled_setting).to eq("test")
|
||||
end
|
||||
end
|
||||
|
||||
describe "commit_hash" do
|
||||
it "should return commit_hash and commit_url" do
|
||||
instance = Plugin::Instance.find_all("#{Rails.root}/spec/fixtures/plugins")[0]
|
||||
subject = described_class.new(instance)
|
||||
|
||||
git_repo = instance.git_repo
|
||||
git_repo.stubs(:latest_local_commit).returns("123456")
|
||||
git_repo.stubs(:url).returns("http://github.com/discourse/discourse-plugin")
|
||||
|
||||
expect(subject.commit_hash).to eq("123456")
|
||||
expect(subject.commit_url).to eq("http://github.com/discourse/discourse-plugin/commit/123456")
|
||||
end
|
||||
end
|
||||
end
|
||||
|
Reference in New Issue
Block a user