Skip to content

Commit 97b71c0

Browse files
committed
Fix failing specs
1 parent beaf50e commit 97b71c0

File tree

7 files changed

+15
-33
lines changed

7 files changed

+15
-33
lines changed

app/models/concerns/better_together/friendly_slug.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ def self.slugged(attribute, **options)
2929
end
3030

3131
def slug= arg, locale: nil, **options
32-
super(arg.parameterize, locale:, **options)
32+
super(arg&.parameterize, locale:, **options)
3333
end
3434
end
3535
end

app/models/concerns/better_together/geography/geospatial/one.rb

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,10 +11,10 @@ module One # rubocop:todo Style/Documentation
1111
dependent: :destroy
1212
has_one :space, through: :geospatial_space
1313

14-
accepts_nested_attributes_for :space
14+
accepts_nested_attributes_for :space, reject_if: :all_blank?, allow_destroy: true
1515

16-
after_create :ensure_space_presence
17-
after_update :ensure_space_presence
16+
# after_create :ensure_space_presence
17+
# after_update :ensure_space_presence
1818

1919
delegate :latitude, :longitude, :elevation, :geocoded, to: :space, allow_nil: true
2020
delegate :latitude=, :longitude=, :elevation=, to: :space

spec/factories/better_together/files.rb

Lines changed: 0 additions & 7 deletions
This file was deleted.
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
# frozen_string_literal: true
2+
3+
FactoryBot.define do
4+
factory 'better_together/upload', aliases: %i[better_together_upload upload] do
5+
type { 'BetterTogether::Upload' }
6+
end
7+
end

spec/helpers/better_together/files_helper_spec.rb renamed to spec/helpers/better_together/uploads_helper_spec.rb

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,17 +3,17 @@
33
require 'rails_helper'
44

55
# Specs in this file have access to a helper object that includes
6-
# the FilesHelper. For example:
6+
# the UploadsHelper. For example:
77
#
8-
# describe FilesHelper do
8+
# describe UploadsHelper do
99
# describe "string concat" do
1010
# it "concats two strings with spaces" do
1111
# expect(helper.concat_strings("this","that")).to eq("this that")
1212
# end
1313
# end
1414
# end
1515
module BetterTogether
16-
RSpec.describe FilesHelper, type: :helper do
16+
RSpec.describe UploadsHelper, type: :helper do
1717
pending "add some examples to (or delete) #{__FILE__}"
1818
end
1919
end

spec/models/better_together/infrastructure/building_spec.rb

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,7 @@ module BetterTogether
5454
building_no_floors = create(:building)
5555
building_no_floors.reload
5656
building_no_floors.floors.destroy_all
57+
# byebug
5758
floor = building_no_floors.ensure_floor
5859
expect(building_no_floors.floors.count).to eq(1)
5960
expect(floor.persisted?).to be_truthy

spec/requests/better_together/files_spec.rb

Lines changed: 0 additions & 19 deletions
This file was deleted.

0 commit comments

Comments
 (0)