Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/diaspora/diaspora.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/spec
diff options
context:
space:
mode:
authordanielgrippi <danielgrippi@gmail.com>2011-07-15 02:56:55 +0400
committerRaphael Sofaer <raphael@joindiaspora.com>2011-07-22 05:22:18 +0400
commita32ef3c1d803f09b82f91a46bc9ca69091df718b (patch)
tree644bd6f073e26d4ce65640e6f5d725b28049a76e /spec
parentbdc4b9f746eca12b50b5d37fd329eeb0bfa75cc5 (diff)
added xml response to the post
Diffstat (limited to 'spec')
-rw-r--r--spec/controllers/publics_controller_spec.rb6
-rw-r--r--spec/models/reshare_spec.rb4
2 files changed, 8 insertions, 2 deletions
diff --git a/spec/controllers/publics_controller_spec.rb b/spec/controllers/publics_controller_spec.rb
index 8f55400fc..b99c0be69 100644
--- a/spec/controllers/publics_controller_spec.rb
+++ b/spec/controllers/publics_controller_spec.rb
@@ -82,6 +82,12 @@ describe PublicsController do
response.should be_redirect
end
+ it 'responds with diaspora xml if format is xml' do
+ status = alice.post(:status_message, :text => "hello", :public => true, :to => 'all')
+ get :post, :guid => status.guid, :format => :xml
+ response.body.should == status.to_diaspora_xml
+ end
+
# We want to be using guids from now on for this post route, but do not want to break
# preexisiting permalinks. We can assume a guid is 8 characters long as we have
# guids set to hex(8) since we started using them.
diff --git a/spec/models/reshare_spec.rb b/spec/models/reshare_spec.rb
index c84890052..f029d5b2d 100644
--- a/spec/models/reshare_spec.rb
+++ b/spec/models/reshare_spec.rb
@@ -81,7 +81,7 @@ describe Reshare do
it 'fetches the root post from root_guid' do
response = mock
response.stub(:body).and_return(@root_object.to_diaspora_xml)
- Faraday.default_connection.should_receive(:get).with(@reshare.root.author.url + public_post_path(:guid => @root_object.guid)).and_return(response)
+ Faraday.default_connection.should_receive(:get).with(@reshare.root.author.url + public_post_path(:guid => @root_object.guid, :format => "xml")).and_return(response)
root = Reshare.from_xml(@xml).root
@@ -101,7 +101,7 @@ describe Reshare do
response = mock
response.stub(:body).and_return(@root_object.to_diaspora_xml)
- Faraday.default_connection.should_receive(:get).with(@original_author.url + public_post_path(:guid => @root_object.guid)).and_return(response)
+ Faraday.default_connection.should_receive(:get).with(@original_author.url + public_post_path(:guid => @root_object.guid, :format => "xml")).and_return(response)
Reshare.from_xml(@xml)
end