17 lines
359 B
Ruby
17 lines
359 B
Ruby
require 'spec_helper'
|
|
|
|
#TODO, is this really a good behaviour?
|
|
describe Symbol do
|
|
it 'to_json becomes a string in json format' do
|
|
:abc.to_json.should == '"abc"'
|
|
end
|
|
|
|
it 'as_json becomes a string in json format' do
|
|
:abc.as_json.should == 'abc'
|
|
end
|
|
|
|
it 'works in hashes' do
|
|
expect([{abc: :def}].to_json).to eq %|[{"abc":"def"}]|
|
|
end
|
|
end
|