Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Update server specs to reflect new behavior for nonexistent pages

  • Loading branch information...
commit 49e0e84020e9cffe60e467f62c995d5dafdd74c2 1 parent 47d30b7
Stephen Judkins stephenjudkins authored
Showing with 2 additions and 28 deletions.
  1. +2 −28 spec/server_spec.rb
30 spec/server_spec.rb
View
@@ -112,35 +112,9 @@ def app; Controller; end
`rm -f data/pages/non-existent-test-page`
end
- after(:all) do
- `rm data/pages/non-existent-test-page`
- end
-
- before(:each) do
+ it "should return 404" do
get "/non-existent-test-page.json"
- @response = last_response
- @body = last_response.body
- @json = JSON.parse(@body)
- end
-
- it "has a factory item" do
- @json['story'].first['type'].should == 'factory'
+ last_response.status.should == 404
end
- it "can convert factory to paragraph" do
- factory = @json['story'].first
- factory['type'] = 'paragraph'
- factory['text'] = 'The quick brown fox jumped over the lazy dogs back.'
- action = {'id'=>factory['id'], 'type'=>'edit', 'item'=>factory }
- put "/page/non-existent-test-page/action", :action => action.to_json
- last_response.body.should == 'ok'
- end
-
- it "has the revision in the story" do
- @json['story'].first['text'].should == 'The quick brown fox jumped over the lazy dogs back.'
- end
-
- it "has an edit action in the journal" do
- @json['journal'].first['type'].should == 'edit'
- end
end
Please sign in to comment.
Something went wrong with that request. Please try again.