debian-mirror-gitlab/spec/controllers/dashboard/snippets_controller_spec.rb

31 lines
640 B
Ruby
Raw Normal View History

2019-12-04 20:38:33 +05:30
# frozen_string_literal: true
require 'spec_helper'
describe Dashboard::SnippetsController do
let(:user) { create(:user) }
before do
sign_in(user)
end
describe 'GET #index' do
it_behaves_like 'paginated collection' do
let(:collection) { Snippet.all }
before do
create(:personal_snippet, :public, author: user)
end
end
2020-03-09 13:42:32 +05:30
it 'fetches snippet counts via the snippet count service' do
service = double(:count_service, execute: {})
expect(Snippets::CountService)
.to receive(:new).with(user, author: user)
.and_return(service)
get :index
end
2019-12-04 20:38:33 +05:30
end
end