Created
September 25, 2008 16:52
-
-
Save paul/12859 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
describe 'creating a article by web services' do | |
before do | |
@result = post('/articles', '{ "title": "My Article", "text": "Lorem Ipsum" }', :content_type => 'application/json') | |
@article_uri = @result.header['Location'] | |
id = parse_route(@article_uri)[:id] | |
@article = Article.get(id) | |
end | |
it 'should be successful' do | |
@result.should be_success | |
end | |
it 'should give the location of the article' do | |
@article_uri.should_not be_nil | |
@article_uri.should =~ %r{/articles/\d+} | |
end | |
it 'should set the title' do | |
@article.title.should == "My Article" | |
end | |
it 'should set the text' | |
# ... | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment