Permalink
Browse files

Changed the order of the Json specs methods to match the order in the…

… class.
  • Loading branch information...
1 parent a7ad136 commit 691089a14467ac5909cefed9ec9d233ac080fd04 Anders Törnqvist committed Jun 9, 2011
Showing with 8 additions and 8 deletions.
  1. +8 −8 spec/resto/format/json_spec.rb
@@ -7,10 +7,16 @@
describe "Resto::Format.get(:json)" do
subject { Resto::Format.get(:json) }
- its(:extension) { should == 'json' }
its(:accept) { should == 'application/json, */*' }
its(:content_type) { should == 'application/json' }
+ describe '.decode(json)' do
+ json = Yajl::Encoder.encode( { :foo => 12425125, :bar => "some string" })
+ expected = { 'foo' => 12425125, 'bar' => "some string" }
+
+ it { subject.decode(json).should == expected }
+ end
+
describe ".encode(hash)" do
before { @result = subject.encode({ :bar => "some string",
:foo => 12425125}) }
@@ -19,11 +25,5 @@
it { @result.should =~ /foo\":12425125/ }
end
- describe '.decode(json)' do
- json = Yajl::Encoder.encode( { :foo => 12425125, :bar => "some string" })
- expected = { 'foo' => 12425125, 'bar' => "some string" }
-
- it { subject.decode(json).should == expected }
- end
-
+ its(:extension) { should == 'json' }
end

0 comments on commit 691089a

Please sign in to comment.