summaryrefslogtreecommitdiff
path: root/spec/serializers
diff options
context:
space:
mode:
authorGrzegorz Bizon <grzesiek.bizon@gmail.com>2016-12-21 15:31:49 +0100
committerGrzegorz Bizon <grzesiek.bizon@gmail.com>2016-12-21 15:31:49 +0100
commite072a2740e4b4112830f16f061704a88d5a9cabb (patch)
treee0bfd9e6448d2fa5f9f176054051fb58a06e663d /spec/serializers
parent468b47d47c004f7a7a2eef7dace2a0b808df9175 (diff)
downloadgitlab-ce-e072a2740e4b4112830f16f061704a88d5a9cabb.tar.gz
Add missing specs for request aware entity module
[ci skip]
Diffstat (limited to 'spec/serializers')
-rw-r--r--spec/serializers/request_aware_entity_spec.rb22
1 files changed, 22 insertions, 0 deletions
diff --git a/spec/serializers/request_aware_entity_spec.rb b/spec/serializers/request_aware_entity_spec.rb
new file mode 100644
index 00000000000..ac23497fad9
--- /dev/null
+++ b/spec/serializers/request_aware_entity_spec.rb
@@ -0,0 +1,22 @@
+require 'spec_helper'
+
+describe RequestAwareEntity do
+ subject do
+ Class.new.include(described_class).new
+ end
+
+ it 'includes URL helpers' do
+ expect(subject).to respond_to(:namespace_project_path)
+ end
+
+ it 'includes method for checking abilities' do
+ expect(subject).to respond_to(:can?)
+ end
+
+ it 'fetches request from options' do
+ expect(subject).to receive(:options)
+ .and_return({request: 'some value'})
+
+ expect(subject.request).to eq 'some value'
+ end
+end