Skip to content

Instantly share code, notes, and snippets.

@cmrd-senya
Created November 1, 2015 22:00
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save cmrd-senya/37614dd5789421e0f2d9 to your computer and use it in GitHub Desktop.
Save cmrd-senya/37614dd5789421e0f2d9 to your computer and use it in GitHub Desktop.
user@debian:~/diaspora$ git diff
diff --git a/spec/federation_messages/federation_messages_spec.rb b/spec/federation_messages/federation_messages_spec.rb
index 349443a..48136e4 100644
--- a/spec/federation_messages/federation_messages_spec.rb
+++ b/spec/federation_messages/federation_messages_spec.rb
@@ -23,7 +23,7 @@ describe "Generation and dispatch of federation messages" do
.to_rack(rack_app)
stub_request(:get, Addressable::Template.new(@testbed_pod + "/hcard/users/test@" + @testbed_pod))
.to_rack(rack_app)
- stub_request(:post, Addressable::Template.new(@testbed_pod + "/receive/users/{guid}")).to_rack(rack_app)
+# stub_request(:post, Addressable::Template.new(@testbed_pod + "/receive/users/{guid}")).to_rack(rack_app)
end
before do
allow_any_instance_of(Postzord::Dispatcher::Private).to receive(:deliver_to_remote).and_call_original
user@debian:~/diaspora$ bundle exec rspec spec/federation_messages/federation_messages_spec.rb
WARNING: Namespace test not found in /home/user/diaspora/config/diaspora.yml
=> Building fixtures
=> Built aspects.yml, contacts.yml, aspect_memberships.yml, people.yml, users.yml, and profiles.yml
Run options: exclude {:performance=>true}
Randomized with seed 30329
1) Generation and dispatch of federation messages user share request works
Failure/Error: expect(alice.share_with(friend, alice.aspects.first)).not_to be_falsy
WebMock::NetConnectNotAllowedError:
Real HTTP connections are disabled. Unregistered request: POST http://pod1.examplea10f88.com/receive/users/bad02b90631101339ba30800276d7a8d with body 'xml=%2B%2B%2B%2B%253C%253Fxml%2Bversion%253D%25271.0%2527%2Bencoding%253D%2527UTF-8%2527%253F%253E%250A%2B%2B%2B%2B%253Cdiaspora%2Bxmlns%253D%2522https%253A%252F%252Fjoindiaspora.com%252Fprotocol%2522%2Bxmlns%253Ame%253D%2522http%253A%252F%252Fsalmon-protocol.org%252Fns%252Fmagic-env%2522%253E%250A%2B%2B%2B%2B%2B%2B%2B%2B%2B%2B%2B%2B%2B%2B%253Cencrypted_header%253E%250A%2B%2B%2B%2B%2B%2B%2B%2B%2B%2BeyJhZXNfa2V5IjoiUFF3L3ZCbHNZNmo1ZzQxRi82VE5SZGpNMmdkVWpjMThtV3ViZGdKTFd1Ky92ZnJQc3dXbjhDRzhSTjFaeGxTRGIwVmlQQjIwVzdVcXRaSHU5RmhwR1lHWVRJdGxoUnR6d2hpNGtldm1TMXZKbXlicUlST2R1U2Q4dGlSYTNVM3crNUNGcUdra28rQkF2ekRrSGFHL3NOdW5nVW1yM3VWQ3dSUEZDMWkrT3hFPSIsImNpcGhlcnRleHQiOiJUQ3JqV3JlbFcrR3NCQzlRQVBpMDhqVjJrWEpCNHFOZk9lczkvTU4vZi9TL1ZYbjdWbjJ4TzM2ZnAvUEJsTEsxaFRoWlV3NHBZdGhIeXFaU2dxY2hBUGZLQTNIMG1adkR4SE9aY0w3K2pLQ3U0T1V1REtjTDY4cXZEZjlxOGE1a2ZDZ3R0VlRzeG5aRFpQblBJT1lSaWhWc1E0ajFibU5xY3VOdndqMGs5L25UMWFCY21GMFN0em9FMDZRenR3R3VCTkRRZGZhVCtJanMrVXlHVnhtNEhYMkpRU1RENEFCb2pnWjM0cWd0emMvVDc3OHg5Z01JRm1wNW45bSs4a0lJcVVQdEFYLzY5WjNlMVB5WjNTWXYvZz09In0%253D%250A%2B%2B%2B%2B%2B%2B%2B%2B%253C%252Fencrypted_header%253E%250A%250A%2B%2B%2B%2B%2B%2B%253Cme%253Aenv%253E%250A%2B%2B%253Cme%253Adata%2Btype%253D%2527application%252Fxml%2527%253EOUNob2lVTGdyditXWWFZQWZmVk9NYmhLa01na0Z3TExaa0huMFliRzg0a2xEMXFqSGNRa2ZzeWRCSXc4endpVzltME05WnUvZkpBMVJiZmhrT2N3SlNqZzJOcnJueW9YUDFkMFZWaEhic1I2YVNxR3grcEVCTHBNNWtsQmZ3dVNNc29YWnlXY3ZlRzNjUU43cFdmOHlkNnVTTjJHN21wN0FObzQ5cXp3cmJoUkpFLzloUVlqbVBpQU94SFdTZm1EK29oYlZzWEhCU1E3MXZmWFNmd0FjSVFqaHNzaWVaL0VDN3lNeEZzbFBqSGRXUjk4YmwyUVpOMzZ0RUs0MlcrK2s0OFhBdjR2RVp5aUR0R055TnFkVkE9PQ%253D%253D%253C%252Fme%253Adata%253E%250A%2B%2B%253Cme%253Aencoding%253Ebase64url%253C%252Fme%253Aencoding%253E%250A%2B%2B%253Cme%253Aalg%253ERSA-SHA256%253C%252Fme%253Aalg%253E%250A%2B%2B%253Cme%253Asig%253EEjFuczRBiTF0HhObVGFa0DprTqZQSa5a_qei97COx34tTEACgR1mSjm6OuCUkG4F55w0P90P8IUfbe0LlnYOSBo8f-7jdF0tYRtoStkMg5GY1ej5yU3RMLjiHYilgDFL-5SYiSYxRc177UC7LzJ7J2vqSq7AP-7sThcacuoW0ig%253D%253C%252Fme%253Asig%253E%250A%2B%2B%253C%252Fme%253Aenv%253E%250A%250A%2B%2B%2B%2B%253C%252Fdiaspora%253E%250A' with headers {'Expect'=>'', 'Transfer-Encoding'=>'', 'User-Agent'=>'Diaspora 0.5.99.0-p7391004e'}
You can stub this request with the following snippet:
stub_request(:post, "http://pod1.examplea10f88.com/receive/users/bad02b90631101339ba30800276d7a8d").
with(:body => "xml=%2B%2B%2B%2B%253C%253Fxml%2Bversion%253D%25271.0%2527%2Bencoding%253D%2527UTF-8%2527%253F%253E%250A%2B%2B%2B%2B%253Cdiaspora%2Bxmlns%253D%2522https%253A%252F%252Fjoindiaspora.com%252Fprotocol%2522%2Bxmlns%253Ame%253D%2522http%253A%252F%252Fsalmon-protocol.org%252Fns%252Fmagic-env%2522%253E%250A%2B%2B%2B%2B%2B%2B%2B%2B%2B%2B%2B%2B%2B%2B%253Cencrypted_header%253E%250A%2B%2B%2B%2B%2B%2B%2B%2B%2B%2BeyJhZXNf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VaL0VDN3lNeEZzbFBqSGRXUjk4YmwyUVpOMzZ0RUs0MlcrK2s0OFhBdjR2RVp5aUR0R055TnFkVkE9PQ%253D%253D%253C%252Fme%253Adata%253E%250A%2B%2B%253Cme%253Aencoding%253Ebase64url%253C%252Fme%253Aencoding%253E%250A%2B%2B%253Cme%253Aalg%253ERSA-SHA256%253C%252Fme%253Aalg%253E%250A%2B%2B%253Cme%253Asig%253EEjFuczRBiTF0HhObVGFa0DprTqZQSa5a_qei97COx34tTEACgR1mSjm6OuCUkG4F55w0P90P8IUfbe0LlnYOSBo8f-7jdF0tYRtoStkMg5GY1ej5yU3RMLjiHYilgDFL-5SYiSYxRc177UC7LzJ7J2vqSq7AP-7sThcacuoW0ig%253D%253C%252Fme%253Asig%253E%250A%2B%2B%253C%252Fme%253Aenv%253E%250A%250A%2B%2B%2B%2B%253C%252Fdiaspora%253E%250A",
:headers => {'Expect'=>'', 'Transfer-Encoding'=>'', 'User-Agent'=>'Diaspora 0.5.99.0-p7391004e'}).
to_return(:status => 200, :body => "", :headers => {})
registered request stubs:
stub_request(:post, "https://pubsubhubbub.appspot.com/")
stub_request(:get, ""pod1.examplea10f88.com/hcard/users/test@pod1.examplea10f88.com" with variables []")
stub_request(:get, ""pod1.examplea10f88.com/webfinger?q=acct:test@pod1.examplea10f88.com" with variables []")
stub_request(:get, ""pod1.examplea10f88.com/.well-known/host-meta" with variables []")
============================================================
# /home/user/.rvm/gems/ruby-2.2.1@diaspora/gems/webmock-1.21.0/lib/webmock/http_lib_adapters/typhoeus_hydra_adapter.rb:161:in `block in <class:TyphoeusAdapter>'
# /home/user/.rvm/gems/ruby-2.2.1@diaspora/gems/typhoeus-0.8.0/lib/typhoeus/hydra/before.rb:21:in `call'
# /home/user/.rvm/gems/ruby-2.2.1@diaspora/gems/typhoeus-0.8.0/lib/typhoeus/hydra/before.rb:21:in `block in add'
# /home/user/.rvm/gems/ruby-2.2.1@diaspora/gems/typhoeus-0.8.0/lib/typhoeus/hydra/before.rb:20:in `each'
# /home/user/.rvm/gems/ruby-2.2.1@diaspora/gems/typhoeus-0.8.0/lib/typhoeus/hydra/before.rb:20:in `add'
# /home/user/.rvm/gems/ruby-2.2.1@diaspora/gems/typhoeus-0.8.0/lib/typhoeus/hydra/queueable.rb:77:in `dequeue_many'
# /home/user/.rvm/gems/ruby-2.2.1@diaspora/gems/typhoeus-0.8.0/lib/typhoeus/hydra/runnable.rb:14:in `run'
# /home/user/.rvm/gems/ruby-2.2.1@diaspora/gems/typhoeus-0.8.0/lib/typhoeus/hydra/memoizable.rb:51:in `run'
# ./lib/hydra_wrapper.rb:23:in `run'
# ./app/workers/http_multi.rb:27:in `perform'
# /home/user/.rvm/gems/ruby-2.2.1@diaspora/gems/sidekiq-3.4.2/lib/sidekiq/testing.rb:171:in `execute_job'
# /home/user/.rvm/gems/ruby-2.2.1@diaspora/gems/sidekiq-3.4.2/lib/sidekiq/testing.rb:156:in `drain'
# /home/user/.rvm/gems/ruby-2.2.1@diaspora/gems/sidekiq-3.4.2/lib/sidekiq/testing.rb:188:in `each'
# /home/user/.rvm/gems/ruby-2.2.1@diaspora/gems/sidekiq-3.4.2/lib/sidekiq/testing.rb:188:in `drain_all'
# ./spec/support/inlined_jobs.rb:5:in `inlined_jobs'
# ./spec/support/user_methods.rb:5:in `share_with'
# ./spec/federation_messages/federation_messages_spec.rb:39:in `block (3 levels) in <top (required)>'
1/1 |========================================================= 100 =========================================================>| Time: 00:00:00
Top 1 slowest examples (0.14793 seconds, 53.0% of total time):
Generation and dispatch of federation messages user share request works
0.14793 seconds ./spec/federation_messages/federation_messages_spec.rb:36
Finished in 0.27933 seconds (files took 10.26 seconds to load)
1 example, 1 failure
Failed examples:
rspec ./spec/federation_messages/federation_messages_spec.rb:36 # Generation and dispatch of federation messages user share request works
Randomized with seed 30329
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment