Remove fixture_builder

This commit is contained in:
Benjamin Neff 2017-04-04 02:36:43 +02:00
parent c0fbc83ccf
commit f8e7b2114f
No known key found for this signature in database
GPG key ID: 971464C3F1A90194
7 changed files with 7 additions and 36 deletions

View file

@ -49,7 +49,6 @@ group :test do
gem "simplecov-rcov", "0.2.3", require: false
# test helpers
gem "fixture_builder", "0.5.0"
gem "json-schema-rspec", "0.0.4"
gem "rspec-collection_matchers", "~> 1.1.2"
gem "rspec-json_expectations", "~> 2.1"

View file

@ -79,9 +79,6 @@ GEM
faraday_middleware (0.11.0.1)
faraday (>= 0.7.4, < 1.0)
ffi (1.9.18)
fixture_builder (0.5.0)
activerecord (>= 2)
activesupport (>= 2)
formatador (0.2.5)
fuubar (2.2.0)
rspec-core (~> 3.0)
@ -300,7 +297,6 @@ DEPENDENCIES
diaspora_federation-json_schema!
diaspora_federation-rails!
diaspora_federation-test!
fixture_builder (= 0.5.0)
fuubar (= 2.2.0)
guard-rspec
guard-rubocop

View file

@ -17,7 +17,7 @@ module DiasporaFederation
public_key: alice.serialized_public_key
).to_xml
get :legacy_webfinger, q: "alice@localhost:3000"
get :legacy_webfinger, q: alice.diaspora_id
expect(response).to be_success
expect(response.body).to eq(webfinger_xrd)
end

View file

@ -37,17 +37,17 @@ module DiasporaFederation
describe "GET #legacy_webfinger", rails: 5 do
it "succeeds when the person exists" do
get :legacy_webfinger, params: {q: "alice@localhost:3000"}
get :legacy_webfinger, params: {q: alice.diaspora_id}
expect(response).to be_success
end
it "succeeds with 'acct:' in the query when the person exists" do
get :legacy_webfinger, params: {q: "acct:alice@localhost:3000"}
get :legacy_webfinger, params: {q: "acct:#{alice.diaspora_id}"}
expect(response).to be_success
end
it "contains the diaspora* ID" do
get :legacy_webfinger, params: {q: "acct:alice@localhost:3000"}
get :legacy_webfinger, params: {q: "acct:#{alice.diaspora_id}"}
expect(response.body).to include "<Subject>acct:alice@localhost:3000</Subject>"
end

View file

@ -28,11 +28,11 @@ require "entities"
# some helper methods
def alice
@alice ||= Person.find_by(diaspora_id: "alice@localhost:3000")
@alice ||= Fabricate(:user, diaspora_id: "alice@localhost:3000")
end
def bob
@bob ||= Person.find_by(diaspora_id: "bob@localhost:3000")
@bob ||= Fabricate(:user, diaspora_id: "bob@localhost:3000")
end
def expect_callback(*opts)
@ -55,10 +55,7 @@ end
# Requires supporting files with custom matchers and macros, etc,
# in ./support/ and its subdirectories.
fixture_builder_file = "#{File.dirname(__FILE__)}/support/fixture_builder.rb"
support_files = Dir["#{File.dirname(__FILE__)}/support/**/*.rb"] - [fixture_builder_file]
support_files.each {|f| require f }
require fixture_builder_file
Dir["#{File.dirname(__FILE__)}/support/**/*.rb"].each {|f| require f }
RSpec.configure do |config|
config.include JSON::SchemaMatchers
@ -76,10 +73,6 @@ RSpec.configure do |config|
config.use_transactional_fixtures = true
# load fixtures
config.fixture_path = "#{::Rails.root}/test/fixtures"
config.global_fixtures = :all
config.filter_run_excluding rails: (Rails::VERSION::MAJOR == 5 ? 4 : 5)
# whitelist codeclimate.com so test coverage can be reported

View file

@ -1,17 +0,0 @@
require "fixture_builder"
FixtureBuilder.configure do |fbuilder|
# rebuild fixtures automatically when these files change:
fbuilder.files_to_check += Dir[
"lib/**/*.rb",
"spec/factories.rb",
"spec/support/fixture_builder.rb",
"test/dummy/app/models/*.rb"
]
# now declare objects
fbuilder.factory do
Fabricate(:user, diaspora_id: "alice@localhost:3000")
Fabricate(:user, diaspora_id: "bob@localhost:3000")
end
end

View file