gitlab-org--gitlab-foss/spec/models/blob_viewer/composer_json_spec.rb
2017-08-02 17:47:31 -04:00

25 lines
575 B
Ruby

require 'spec_helper'
describe BlobViewer::ComposerJson do
include FakeBlobHelpers
let(:project) { build_stubbed(:project) }
let(:data) do
<<-SPEC.strip_heredoc
{
"name": "laravel/laravel",
"homepage": "https://laravel.com/"
}
SPEC
end
let(:blob) { fake_blob(path: 'composer.json', data: data) }
subject { described_class.new(blob) }
describe '#package_name' do
it 'returns the package name' do
expect(subject).to receive(:prepare!)
expect(subject.package_name).to eq('laravel/laravel')
end
end
end