diff options
Diffstat (limited to 'spec/serializers/detailed_status_entity_spec.rb')
-rw-r--r-- | spec/serializers/detailed_status_entity_spec.rb | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/spec/serializers/detailed_status_entity_spec.rb b/spec/serializers/detailed_status_entity_spec.rb new file mode 100644 index 00000000000..62f57ca8689 --- /dev/null +++ b/spec/serializers/detailed_status_entity_spec.rb @@ -0,0 +1,24 @@ +require 'spec_helper' + +describe DetailedStatusEntity do + let(:entity) { described_class.new(status) } + + let(:status) do + Gitlab::Ci::Status::Success.new(double('object'), double('user')) + end + + before do + allow(status).to receive(:has_details?).and_return(true) + allow(status).to receive(:details_path).and_return('some/path') + end + + describe '#as_json' do + subject { entity.as_json } + + it 'contains status details' do + expect(subject).to include :text, :icon, :favicon, :label, :group, :tooltip + expect(subject).to include :has_details, :details_path + expect(subject[:favicon]).to match_asset_path('/assets/ci_favicons/favicon_status_success.png') + end + end +end |