remove multi server spec files

This commit is contained in:
Maxwell Salzberg 2012-02-14 12:08:11 -08:00
parent d9fd978f9d
commit 326103adb6
4 changed files with 0 additions and 231 deletions

View file

@ -1,47 +0,0 @@
require 'spec_helper'
unless Server.all.empty?
describe "commenting" do
before(:all) do
Server.start
end
after(:all) do
Server.stop
end
before do
Server.truncate_databases
@post = nil
Server[0].in_scope do
poster = Factory(:user_with_aspect, :username => "poster")
@post = poster.post(:status_message,
:public => true,
:text => "Awesome Sauce!",
:to => 'all')
end
Server[1].in_scope do
commenter = Factory(:user_with_aspect, :username => "commenter")
person = Webfinger.new("poster@localhost:#{Server[0].port}").fetch
person.save!
Reshare.fetch_post(person, @post.guid).save!
end
end
it 'allows an unknown commenter to comment on a public post' do
pending
Server[1].in_scope do
commenter = User.find_by_username("commenter")
commenter.comment("Hey", :post => Post.find_by_guid(@post.guid))
end
Server[0].in_scope do
Person.exists?(:diaspora_handle => "commenter@localhost:#{Server[1].port}").should be_true
@post.reload.comments.size.should == 0
end
end
end
end

View file

@ -1,60 +0,0 @@
require 'spec_helper'
unless Server.all.empty?
describe "commenting" do
before(:all) do
Server.start
end
after(:all) do
Server.stop
end
before do
Server.truncate_databases
@post = nil
Server[0].in_scope do
Factory(:user_with_aspect, :username => "poster")
end
Server[1].in_scope do
recipient = Factory(:user_with_aspect, :username => "recipient")
recipients_aspect = recipient.aspects.where(:name => "generic").first
person = Webfinger.new("poster@localhost:#{Server[0].port}").fetch
person.save!
recipient.share_with(person, recipients_aspect)
end
end
it 'sends public posts to remote followers' do
Server[0].in_scope do
@post = User.find_by_username("poster").
post(:status_message,
:public => true,
:text => "Awesome Sauce!",
:to => 'all')
end
Server[1].in_scope do
Post.exists?(:guid => @post.guid).should be_true
end
end
it 'sends public posts to remote friends' do
Server[0].in_scope do
poster = User.find_by_username("poster")
posters_aspect = poster.aspects.where(:name => "generic").first
person = Person.find_by_diaspora_handle("recipient@localhost:#{Server[1].port}")
poster.share_with(person, posters_aspect)
@post = poster.
post(:status_message,
:public => true,
:text => "Awesome Sauce!",
:to => 'all')
end
Server[1].in_scope do
Post.exists?(:guid => @post.guid).should be_true
end
end
end
end

View file

@ -1,71 +0,0 @@
require 'spec_helper'
unless Server.all.empty?
describe "reposting" do
before(:all) do
Server.start
end
after(:all) do
Server.stop
end
before do
Server.truncate_databases
@original_post = nil
Server[0].in_scope do
original_poster = Factory(:user_with_aspect, :username => "original_poster")
resharer = Factory(:user_with_aspect, :username => "resharer")
connect_users_with_aspects(original_poster, resharer)
@original_post = original_poster.post(:status_message,
:public => true,
:text => "Awesome Sauce!",
:to => 'all')
end
Server[1].in_scope do
recipient = Factory(:user_with_aspect, :username => "recipient")
end
Server[0].in_scope do
r = User.find_by_username("resharer")
rs_aspect = r.aspects.where(:name => "generic").first
person = Webfinger.new("recipient@localhost:#{Server[1].port}").fetch
r.share_with(person, rs_aspect)
end
Server[1].in_scope do
r = User.find_by_username("recipient")
rs_aspect = r.aspects.where(:name => "generic").first
person = Webfinger.new("resharer@localhost:#{Server[0].port}").fetch
r.share_with(person, rs_aspect)
end
Server[0].in_scope do
r = User.find_by_username("resharer")
r.post(:reshare, :root_guid => @original_post.guid, :to => 'all')
end
end
it 'fetches the original post from the root server' do
Server[1].in_scope do
Post.exists?(:guid => @original_post.guid).should be_true
end
end
it 'relays the retraction for the root post to recipients of the reshare' do
Server[0].in_scope do
poster = User.find_by_username 'original_poster'
fantasy_resque do
poster.retract @original_post
end
end
Server[1].in_scope do
Post.exists?(:guid => @original_post.guid).should be_false
end
end
end
end

View file

@ -1,53 +0,0 @@
#This is a spec for the class that runs the servers used in the other multi-server specs
require 'spec_helper'
unless Server.all.empty?
describe Server do
before(:all) do
Server.start
end
after(:all) do
Server.stop
end
before do
Server.truncate_databases
end
describe '.all' do
it 'returns a server object for each server' do
integration_envs = ActiveRecord::Base.configurations.keys.select{ |k| k.include?("integration") }
integration_envs.count.should == Server.all.count
end
end
describe '#initialize' do
it 'takes an environment' do
server = Server.new("integration_1")
server.env.should == "integration_1"
end
end
describe "#running?" do
it "verifies that the server is running" do
server = Server.new("integration_1")
server.running?.should be_true
end
end
describe '#db' do
it 'runs the given code in the context of that server' do
servers = Server.all
test_user_count = User.count
servers.first.db do
User.count.should == 0
Factory :user
User.count.should == 1
end
User.count.should == test_user_count
servers.last.db do
User.count.should == 0
end
end
end
end
end