Skip to content

Commit

Permalink
Fix legal terms regression
Browse files Browse the repository at this point in the history
  • Loading branch information
mayorova committed Sep 18, 2024
1 parent 33e9a2b commit 4924c8d
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 1 deletion.
2 changes: 1 addition & 1 deletion app/models/cms/builtin/legal_term.rb
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,6 @@ def content_type
private

def publish_draft
self.published = draft unless published
self.published = draft
end
end
10 changes: 10 additions & 0 deletions test/unit/cms/builtin/legal_term_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -23,4 +23,14 @@ def setup
assert_not_empty lt.errors[:system_name]
end

test 'published is filled with draft value' do
value = 'some text'
lt = @provider.builtin_legal_terms.create(system_name: 'signup_licence', draft: value)
assert_equal value, lt.published

new_value = 'updated text'
lt.update(draft: new_value)
assert_equal new_value, lt.published
end

end

0 comments on commit 4924c8d

Please sign in to comment.