summaryrefslogtreecommitdiff
path: root/spec/features/projects/blobs/blob_show_spec.rb
diff options
context:
space:
mode:
Diffstat (limited to 'spec/features/projects/blobs/blob_show_spec.rb')
-rw-r--r--spec/features/projects/blobs/blob_show_spec.rb46
1 files changed, 41 insertions, 5 deletions
diff --git a/spec/features/projects/blobs/blob_show_spec.rb b/spec/features/projects/blobs/blob_show_spec.rb
index 9888624a509..82cfbfda157 100644
--- a/spec/features/projects/blobs/blob_show_spec.rb
+++ b/spec/features/projects/blobs/blob_show_spec.rb
@@ -6,7 +6,7 @@ feature 'File blob', :js, feature: true do
def visit_blob(path, fragment = nil)
visit namespace_project_blob_path(project.namespace, project, File.join('master', path), anchor: fragment)
- wait_for_ajax
+ wait_for_requests
end
context 'Ruby file' do
@@ -61,7 +61,7 @@ feature 'File blob', :js, feature: true do
before do
find('.js-blob-viewer-switch-btn[data-viewer=simple]').click
- wait_for_ajax
+ wait_for_requests
end
it 'displays the blob using the simple viewer' do
@@ -82,7 +82,7 @@ feature 'File blob', :js, feature: true do
before do
find('.js-blob-viewer-switch-btn[data-viewer=rich]').click
- wait_for_ajax
+ wait_for_requests
end
it 'displays the blob using the rich viewer' do
@@ -170,7 +170,7 @@ feature 'File blob', :js, feature: true do
before do
find('.js-blob-viewer-switcher .js-blob-viewer-switch-btn[data-viewer=simple]').click
- wait_for_ajax
+ wait_for_requests
end
it 'displays an error' do
@@ -423,7 +423,43 @@ feature 'File blob', :js, feature: true do
expect(page).to have_content('This project is licensed under the MIT License.')
# shows a learn more link
- expect(page).to have_link('Learn more about this license', 'http://choosealicense.com/licenses/mit/')
+ expect(page).to have_link('Learn more', 'http://choosealicense.com/licenses/mit/')
+ end
+ end
+ end
+
+ context '*.gemspec' do
+ before do
+ project.add_master(project.creator)
+
+ Files::CreateService.new(
+ project,
+ project.creator,
+ start_branch: 'master',
+ branch_name: 'master',
+ commit_message: "Add activerecord.gemspec",
+ file_path: 'activerecord.gemspec',
+ file_content: <<-SPEC.strip_heredoc
+ Gem::Specification.new do |s|
+ s.platform = Gem::Platform::RUBY
+ s.name = "activerecord"
+ end
+ SPEC
+ ).execute
+
+ visit_blob('activerecord.gemspec')
+ end
+
+ it 'displays an auxiliary viewer' do
+ aggregate_failures do
+ # shows names of dependency manager and package
+ expect(page).to have_content('This project manages its dependencies using RubyGems and defines a gem named activerecord.')
+
+ # shows a link to the gem
+ expect(page).to have_link('activerecord', 'https://rubygems.org/gems/activerecord')
+
+ # shows a learn more link
+ expect(page).to have_link('Learn more', 'http://choosealicense.com/licenses/mit/')
end
end
end