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:
Vinoth Kannan
2023-06-26 10:09:57 +05:30
committed by GitHub
parent a183f14d09
commit 52894b9d7c
11 changed files with 125 additions and 2 deletions

View File

@ -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