diff options
Diffstat (limited to 'spec/serializers/runner_entity_spec.rb')
-rw-r--r-- | spec/serializers/runner_entity_spec.rb | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/spec/serializers/runner_entity_spec.rb b/spec/serializers/runner_entity_spec.rb new file mode 100644 index 00000000000..4f25a8dcfa0 --- /dev/null +++ b/spec/serializers/runner_entity_spec.rb @@ -0,0 +1,23 @@ +require 'spec_helper' + +describe RunnerEntity do + let(:runner) { create(:ci_runner, :specific) } + let(:entity) { described_class.new(runner, request: request, current_user: user) } + let(:request) { double('request') } + let(:project) { create(:empty_project) } + let(:user) { create(:admin) } + + before do + allow(request).to receive(:current_user).and_return(user) + allow(request).to receive(:project).and_return(project) + end + + describe '#as_json' do + subject { entity.as_json } + + it 'contains required fields' do + expect(subject).to include(:id, :description) + expect(subject).to include(:edit_path) + end + end +end |