summaryrefslogtreecommitdiff
path: root/spec/helpers
diff options
context:
space:
mode:
authorGitLab Bot <gitlab-bot@gitlab.com>2021-01-19 09:10:32 +0000
committerGitLab Bot <gitlab-bot@gitlab.com>2021-01-19 09:10:32 +0000
commitfcef382cb994b8ecdbff75490bab0425a35f2641 (patch)
tree1789e9bbda6c4beea4451feb7970705296787445 /spec/helpers
parentb8f44765693d6f6e4c8df6ab7b7c7b1141f83b26 (diff)
downloadgitlab-ce-fcef382cb994b8ecdbff75490bab0425a35f2641.tar.gz
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'spec/helpers')
-rw-r--r--spec/helpers/blob_helper_spec.rb9
1 files changed, 5 insertions, 4 deletions
diff --git a/spec/helpers/blob_helper_spec.rb b/spec/helpers/blob_helper_spec.rb
index 3366b7eeadf..b584a906565 100644
--- a/spec/helpers/blob_helper_spec.rb
+++ b/spec/helpers/blob_helper_spec.rb
@@ -16,7 +16,7 @@ RSpec.describe BlobHelper do
end
end
- describe "#edit_blob_link" do
+ describe "#edit_blob_button" do
let(:namespace) { create(:namespace, name: 'gitlab') }
let(:project) { create(:project, :repository, namespace: namespace) }
@@ -28,12 +28,13 @@ RSpec.describe BlobHelper do
allow(helper).to receive(:can_collaborate_with_project?).and_return(true)
end
- it 'verifies blob is text' do
+ it 'does not render edit button when blob is not text' do
expect(helper).not_to receive(:blob_text_viewable?)
- button = helper.edit_blob_button(project, 'refs/heads/master', 'README.md')
+ # RADME.md is not a valid file.
+ button = helper.edit_blob_button(project, 'refs/heads/master', 'RADME.md')
- expect(button).to start_with('<button')
+ expect(button).to eq(nil)
end
it 'uses the passed blob instead retrieve from repository' do