From f8e7b2114f2ba7e7bed057bc61806015d5e9b04a Mon Sep 17 00:00:00 2001 From: Benjamin Neff Date: Tue, 4 Apr 2017 02:36:43 +0200 Subject: [PATCH] Remove fixture_builder --- Gemfile | 1 - Gemfile.lock | 4 ---- .../diaspora_federation/rails4_spec.rb | 2 +- .../webfinger_controller_spec.rb | 6 +++--- spec/spec_helper.rb | 13 +++---------- spec/support/fixture_builder.rb | 17 ----------------- test/dummy/test/fixtures/.keep | 0 7 files changed, 7 insertions(+), 36 deletions(-) delete mode 100644 spec/support/fixture_builder.rb delete mode 100644 test/dummy/test/fixtures/.keep diff --git a/Gemfile b/Gemfile index f214e7c..e3dca6e 100644 --- a/Gemfile +++ b/Gemfile @@ -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" diff --git a/Gemfile.lock b/Gemfile.lock index ae5b2e6..7e1b1ba 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -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 diff --git a/spec/controllers/diaspora_federation/rails4_spec.rb b/spec/controllers/diaspora_federation/rails4_spec.rb index f38381f..4d506b5 100644 --- a/spec/controllers/diaspora_federation/rails4_spec.rb +++ b/spec/controllers/diaspora_federation/rails4_spec.rb @@ -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 diff --git a/spec/controllers/diaspora_federation/webfinger_controller_spec.rb b/spec/controllers/diaspora_federation/webfinger_controller_spec.rb index 7403d55..e26ceeb 100644 --- a/spec/controllers/diaspora_federation/webfinger_controller_spec.rb +++ b/spec/controllers/diaspora_federation/webfinger_controller_spec.rb @@ -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 "acct:alice@localhost:3000" end diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb index a1b07ab..234cdf3 100644 --- a/spec/spec_helper.rb +++ b/spec/spec_helper.rb @@ -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 diff --git a/spec/support/fixture_builder.rb b/spec/support/fixture_builder.rb deleted file mode 100644 index 095e65b..0000000 --- a/spec/support/fixture_builder.rb +++ /dev/null @@ -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 diff --git a/test/dummy/test/fixtures/.keep b/test/dummy/test/fixtures/.keep deleted file mode 100644 index e69de29..0000000