From c2e5237da57312fedc06b801d204fb70bc012d82 Mon Sep 17 00:00:00 2001 From: mo khan Date: Sun, 20 Jul 2014 10:14:46 -0600 Subject: save a new tutorial and their tags. --- spec/controllers/api/v1/tutorials_controller_spec.rb | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'spec/controllers/api/v1/tutorials_controller_spec.rb') 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 -- cgit v1.2.3