summaryrefslogtreecommitdiff
path: root/spec/features/projects/snippets_spec.rb
diff options
context:
space:
mode:
authorAchilleas Pipinellis <axilleas@axilleas.me>2017-05-10 18:57:19 +0000
committerAchilleas Pipinellis <axilleas@axilleas.me>2017-05-10 18:57:19 +0000
commit9c7d87ef0ec941b389cb5ef57a07ff0f43909305 (patch)
tree827aaf4dbb628eb31517aaf2960814a521430229 /spec/features/projects/snippets_spec.rb
parent1e0df21a74017deb780023ed83f04dbbeed13899 (diff)
parent180ec7113e358a7f8388e1436dc0670a11ba68df (diff)
downloadgitlab-ce-docs/hide-gcp-install.tar.gz
Merge branch 'master' into 'docs/hide-gcp-install'docs/hide-gcp-install
# Conflicts: # doc/install/README.md
Diffstat (limited to 'spec/features/projects/snippets_spec.rb')
-rw-r--r--spec/features/projects/snippets_spec.rb24
1 files changed, 20 insertions, 4 deletions
diff --git a/spec/features/projects/snippets_spec.rb b/spec/features/projects/snippets_spec.rb
index d37e8ed4699..18689c17fe9 100644
--- a/spec/features/projects/snippets_spec.rb
+++ b/spec/features/projects/snippets_spec.rb
@@ -4,11 +4,27 @@ describe 'Project snippets', feature: true do
context 'when the project has snippets' do
let(:project) { create(:empty_project, :public) }
let!(:snippets) { create_list(:project_snippet, 2, :public, author: project.owner, project: project) }
- before do
- allow(Snippet).to receive(:default_per_page).and_return(1)
- visit namespace_project_snippets_path(project.namespace, project)
+ let!(:other_snippet) { create(:project_snippet) }
+
+ context 'pagination' do
+ before do
+ allow(Snippet).to receive(:default_per_page).and_return(1)
+
+ visit namespace_project_snippets_path(project.namespace, project)
+ end
+
+ it_behaves_like 'paginated snippets'
end
- it_behaves_like 'paginated snippets'
+ context 'list content' do
+ it 'contains all project snippets' do
+ visit namespace_project_snippets_path(project.namespace, project)
+
+ expect(page).to have_selector('.snippet-row', count: 2)
+
+ expect(page).to have_content(snippets[0].title)
+ expect(page).to have_content(snippets[1].title)
+ end
+ end
end
end