Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/diaspora/diaspora.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorcmrd Senya <senya@riseup.net>2018-03-16 21:22:58 +0300
committerBenjamin Neff <benjamin@coding4coffee.ch>2018-03-25 09:28:59 +0300
commite0e40f73c32c3bf4e118f665915333e6a6952016 (patch)
tree1fe45a8e3e06e3b0340f22f685eee0ba25d60645 /spec/controllers
parentf632f8a1f8fef3e7c9303c2ef373d72b929994aa (diff)
Spec for post creation bad aspects_ids issue
Diffstat (limited to 'spec/controllers')
-rw-r--r--spec/controllers/status_messages_controller_spec.rb6
1 files changed, 6 insertions, 0 deletions
diff --git a/spec/controllers/status_messages_controller_spec.rb b/spec/controllers/status_messages_controller_spec.rb
index c954ce4c6..d38c12289 100644
--- a/spec/controllers/status_messages_controller_spec.rb
+++ b/spec/controllers/status_messages_controller_spec.rb
@@ -132,6 +132,12 @@ describe StatusMessagesController, :type => :controller do
status_message = StatusMessage.find_by_text(text)
expect(status_message.aspect_visibilities.map(&:aspect)).to match_array([@aspect1, @aspect2])
end
+
+ it "responses 422 when aspect_ids don't contain any applicable aspect identifiers" do
+ bad_ids = [Aspect.ids.max.next, bob.aspects.first.id]
+ post :create, params: status_message_hash.merge(aspect_ids: bad_ids.to_s), format: :json
+ expect(response.status).to eq(422)
+ end
end
it "dispatches the post to the specified services" do