Skip to content

Commit

Permalink
Merge branch '99-rails3' of http://github.com/davidpaniz/restfulie in…
Browse files Browse the repository at this point in the history
…to 99-rails3
  • Loading branch information
guilhermesilveira committed Aug 18, 2010
2 parents f6be001 + dc90fc6 commit 7beb5d2
Show file tree
Hide file tree
Showing 7 changed files with 17 additions and 22 deletions.
Expand Up @@ -6,7 +6,7 @@ module ActionController
module CreatedResponder

def to_format
if [201, :created].include? options[:status]
if (options[:status] == 201) || (options[:status] == :created)
head :status => 201, :location => controller.url_for(resource)
else
super
Expand Down
@@ -0,0 +1,5 @@
require 'spec_helper'

describe Type do

end
@@ -1,4 +1,4 @@
require File.expand_path(File.dirname(__FILE__) + '/../spec_helper')
require File.expand_path(File.dirname(__FILE__) + '/../../spec_helper')

describe AlbumsController do

Expand Down
@@ -1,4 +1,4 @@
require 'spec_helper'
require File.expand_path(File.dirname(__FILE__) + '/../../spec_helper')

describe CacheableClientsController do
before(:each) do
Expand Down
Expand Up @@ -15,24 +15,20 @@ def create

end

ActionController::Routing::Routes.draw do |map|
map.connect ':controller/:action/:id'
end

describe CreationController, :type => :controller do

before(:each) do
request.accept = "application/atom+xml"
end
describe CreationController do

context "creating a resource" do

it "should return 201 with location" do
request.accept = "application/atom+xml"

uri = "http://newlocation.com/uri"
controller.should_receive(:url_for).and_return uri

controller.stub(:url_for).and_return uri

post :create
controller.response.code.should == "201"
controller.response.headers["Location"].should == uri
response.code.should == "201"
response.headers["Location"].should == uri
end

end
Expand Down
@@ -1,4 +1,4 @@
require 'spec_helper'
require File.expand_path(File.dirname(__FILE__) + '/../../spec_helper')

describe ProjectsController do

Expand Down
6 changes: 0 additions & 6 deletions tests/spec/controllers/songs_controller_spec.rb

This file was deleted.

0 comments on commit 7beb5d2

Please sign in to comment.