mirror of
https://github.com/discourse/discourse.git
synced 2025-05-24 03:36:18 +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:
17
spec/lib/git_repo_spec.rb
Normal file
17
spec/lib/git_repo_spec.rb
Normal file
@ -0,0 +1,17 @@
|
||||
# frozen_string_literal: true
|
||||
|
||||
RSpec.describe GitRepo do
|
||||
let(:git_repo) { GitRepo.new("/tmp", "discourse") }
|
||||
|
||||
it "returns the correct URL" do
|
||||
Discourse::Utils.stubs(:execute_command).returns("https://github.com/username/my_plugin.git")
|
||||
expect(git_repo.url).to eq("https://github.com/username/my_plugin")
|
||||
Discourse::Utils.stubs(:execute_command).returns("git@github.com/username/my_plugin.git")
|
||||
expect(git_repo.url).to eq("https://github.com/username/my_plugin")
|
||||
end
|
||||
|
||||
it "returns the correct commit hash" do
|
||||
Discourse::Utils.expects(:execute_command).returns("123456")
|
||||
expect(git_repo.latest_local_commit).to eq("123456")
|
||||
end
|
||||
end
|
Reference in New Issue
Block a user