spec/redfinger/client_spec.rb in redfinger-0.0.5 vs spec/redfinger/client_spec.rb in redfinger-0.0.6
- old
+ new
@@ -2,18 +2,14 @@
class HaltSuccessError < StandardError; end
describe Redfinger::Client do
describe '#new' do
- it 'should add acct: if it is not in URI form' do
- Redfinger::Client.new('abc@example.com').account.should == 'acct:abc@example.com'
+ it 'should remove acct: if it is already in URI form' do
+ Redfinger::Client.new('acct:abc@example.com').account.should == 'abc@example.com'
end
- it 'should not add acct: if it is already in URI form' do
- Redfinger::Client.new('acct:abc@example.com').account.should == 'acct:abc@example.com'
- end
-
it 'should set the domain to whatevers after the @ sign' do
Redfinger::Client.new('abc@example.com').domain.should == 'example.com'
Redfinger::Client.new('abc@frog.co.uk').domain.should == 'frog.co.uk'
end
end
@@ -42,14 +38,9 @@
end
it 'should return the template' do
stub_request(:get, 'https://example.com/.well-known/host-meta').to_return(:status => 200, :body => host_xrd)
Redfinger::Client.new('acct:abc@example.com').send(:retrieve_template_from_xrd).should == 'http://example.com/webfinger/?q={uri}'
- end
-
- it 'should raise a SecurityException if there is a host mismatch' do
- stub_request(:get, 'https://franklin.com/.well-known/host-meta').to_return(:status => 200, :body => host_xrd)
- lambda{Redfinger::Client.new('acct:abc@franklin.com').send(:retrieve_template_from_xrd)}.should raise_error(Redfinger::SecurityException)
end
end
describe '#finger' do
it 'should fetch the URI template if is not set' do
\ No newline at end of file