summaryrefslogtreecommitdiff
path: root/spec
diff options
context:
space:
mode:
authorZeger-Jan van de Weg <zegerjan@gitlab.com>2016-05-12 13:27:25 +0200
committerAlfredo Sumaran <alfredo@gitlab.com>2016-05-20 15:58:36 -0500
commit79620c501da19bfda5818b8dca75b6ec9c10e762 (patch)
treedeff7dbc8d3c60410543cc723e21ae438796e78f /spec
parent1f5fcb638d6b432d76a639ccc35acc94d8ae6ac7 (diff)
downloadgitlab-ce-79620c501da19bfda5818b8dca75b6ec9c10e762.tar.gz
Update API and fetching task
Diffstat (limited to 'spec')
-rw-r--r--spec/lib/gitlab/gitignore_spec.rb4
-rw-r--r--spec/requests/api/gitignores_spec.rb4
2 files changed, 5 insertions, 3 deletions
diff --git a/spec/lib/gitlab/gitignore_spec.rb b/spec/lib/gitlab/gitignore_spec.rb
index 5dab821a8ec..72baa516cc4 100644
--- a/spec/lib/gitlab/gitignore_spec.rb
+++ b/spec/lib/gitlab/gitignore_spec.rb
@@ -2,6 +2,7 @@ require 'spec_helper'
describe Gitlab::Gitignore do
subject { Gitlab::Gitignore }
+
describe '.all' do
it 'strips the gitignore suffix' do
expect(subject.all.first.name).not_to end_with('.gitignore')
@@ -24,12 +25,13 @@ describe Gitlab::Gitignore do
ruby = subject.find('Ruby')
expect(ruby).to be_a Gitlab::Gitignore
+ expect(ruby.name).to eq('Ruby')
end
end
describe '#content' do
it 'loads the full file' do
- gitignore = subject.new('Ruby', File.expand_path('vendor/gitignore', Rails.root))
+ gitignore = subject.new(Rails.root.join('vendor/gitignore/Ruby.gitignore'))
expect(gitignore.name).to eq 'Ruby'
expect(gitignore.content).to start_with('*.gem')
diff --git a/spec/requests/api/gitignores_spec.rb b/spec/requests/api/gitignores_spec.rb
index d0e576e637c..aab2d8c81b9 100644
--- a/spec/requests/api/gitignores_spec.rb
+++ b/spec/requests/api/gitignores_spec.rb
@@ -13,8 +13,8 @@ describe API::Gitignores, api: true do
describe 'Entity GitignoresList' do
before { get api('/gitignores') }
- it { expect(json_response.first['name']).to be_truthy }
- it { expect(json_response.first['content']).to be_falsey }
+ it { expect(json_response.first['name']).not_to be_nil }
+ it { expect(json_response.first['content']).to be_nil }
end
describe 'GET /gitignores' do