summaryrefslogtreecommitdiff
path: root/spec/controllers/api/v1/tutorials_controller_spec.rb
diff options
context:
space:
mode:
authormo khan <mo@mokhan.ca>2014-07-20 10:14:46 -0600
committermo khan <mo@mokhan.ca>2014-07-20 10:14:46 -0600
commitc2e5237da57312fedc06b801d204fb70bc012d82 (patch)
tree0a3938f57662eb13f386d6d2d4431cea3ed8c67a /spec/controllers/api/v1/tutorials_controller_spec.rb
parent8604e242169e1a9e1630fce6de02b7fca8c55856 (diff)
save a new tutorial and their tags.
Diffstat (limited to 'spec/controllers/api/v1/tutorials_controller_spec.rb')
-rw-r--r--spec/controllers/api/v1/tutorials_controller_spec.rb4
1 files changed, 4 insertions, 0 deletions
diff --git a/spec/controllers/api/v1/tutorials_controller_spec.rb b/spec/controllers/api/v1/tutorials_controller_spec.rb
index e4845072..435e6136 100644
--- a/spec/controllers/api/v1/tutorials_controller_spec.rb
+++ b/spec/controllers/api/v1/tutorials_controller_spec.rb
@@ -26,6 +26,7 @@ describe Api::V1::TutorialsController do
image_url: "https://abs.twimg.com/a/1405611403/img/t1/front_page/exp_wc2014_gen_laurenlemon.jpg",
heading: "Twitter",
description: "Connect with your friends - and other fascinating people. Get in-the-moment updates on the things that interest you. And watch events unfold, in real time, from every angle.",
+ tags: "cake,cookie",
}
post :create, tutorial: attributes, format: :json
@@ -33,6 +34,9 @@ describe Api::V1::TutorialsController do
expect(assigns(:tutorial).url).to eql(attributes[:url])
expect(assigns(:tutorial).description).to eql(attributes[:description])
expect(assigns(:tutorial).heading).to eql(attributes[:heading])
+ expect(assigns(:tutorial).tags.count).to eql(2)
+ expect(assigns(:tutorial).tags.first.name).to eql('cake')
+ expect(assigns(:tutorial).tags.last.name).to eql('cookie')
end
end
end