Skip to content

Commit

Permalink
Forgot to test that default attributes can be overriden
Browse files Browse the repository at this point in the history
  • Loading branch information
kaspth committed Aug 12, 2023
1 parent 2088a97 commit 4376378
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
6 changes: 5 additions & 1 deletion test/oaken_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -24,13 +24,17 @@ def test_accessing_fixture
assert_equal [users.kasper, users.coworker], accounts.business.users
end

def test_default_attributes_override
assert_equal "Big Business Co.", accounts.business.name
end

def test_default_attributes_last_into_test
users.update :homer
assert_equal [accounts.business], users.homer.accounts
end

def test_default_attributes_block
users.with accounts: [accounts.update(:home_co, name: "Yo")] do
users.with accounts: [accounts.update(:home_co)] do
users.update :homer
end
assert_equal [accounts.home_co], users.homer.accounts
Expand Down
1 change: 1 addition & 0 deletions test/seeds.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
accounts.with name: -> { id.to_s.humanize }
accounts.update :business, name: "Big Business Co."

users.with name: -> { id.to_s.capitalize }, accounts: [accounts.business]
Expand Down

0 comments on commit 4376378

Please sign in to comment.