Commit 64870693 by Rocky Duan

fixed spec

parent 33ded5c1
...@@ -92,14 +92,11 @@ describe "app" do ...@@ -92,14 +92,11 @@ describe "app" do
thread.tags_array.should include "c" thread.tags_array.should include "c"
end end
it "accepts [a-z 0-9 + # - .]words, numbers, dashes, spaces but no underscores in tags" do it "accepts [a-z 0-9 + # - .]words, numbers, dashes, spaces but no underscores in tags" do
post '/api/v1/question_1/threads', default_params.merge(tags: "artificial-intelligence, machine-learning, 7-is-a-lucky-number, interesting problem") post '/api/v1/question_1/threads', default_params.merge(tags: "artificial-intelligence, machine-learning, 7-is-a-lucky-number, interesting problem, interesting problems in c++")
last_response.should be_ok last_response.should be_ok
CommentThread.count.should == 3 CommentThread.count.should == 3
thread = CommentThread.where(title: "Interesting question").first thread = CommentThread.where(title: "Interesting question").first
thread.tags_array.length.should == 3 thread.tags_array.length.should == 5
thread.tags_array.should include "a"
thread.tags_array.should include "b"
thread.tags_array.should include "c"
end end
end end
end end
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment