Skip to content

Commit

Permalink
Demonstrate invalid #to_formatted_s assumptions. NUBIC#459.
Browse files Browse the repository at this point in the history
  • Loading branch information
David Yip committed Jun 21, 2013
1 parent b3322c6 commit 22a3d5a
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions spec/models/response_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -128,6 +128,18 @@
end
end

describe Response, '#to_formatted_s' do
context "when datetime" do
let(:r) { Response.new(:answer => Answer.new(:response_class => 'datetime')) }

it 'returns "" when nil' do
r.datetime_value = nil

r.to_formatted_s.should == ""
end
end
end

describe Response, '#json_value' do
context "when integer" do
let(:r) {Response.new(:integer_value => 2, :answer => Answer.new(:response_class => 'integer'))}
Expand Down

0 comments on commit 22a3d5a

Please sign in to comment.