* Create DiscussionLocks
* Fix specs
* Update nullify_blank_notes_and_reason
* Update before_validation call
* Updated DiscussionLockPolicy for clarity
* Move permitted_attributes to a constant
* Update route
* Apply suggestions from code review for frontend
Co-authored-by: Suzanne Aitchison <suzanne@forem.com>
* Add title tags
* Wrap unlock confirm in main element
* Wrap flash messages up in div
* Actually fix title tags
* Hide comment reply button when discussion is locked
* Add E2E tests
* Try to fix E2E tests
* Cypress...you work locally but not in CI...why!?
* PR feedback
* Update E2E tests
* More E2E updates 😭
Co-authored-by: Suzanne Aitchison <suzanne@forem.com>
18 lines
517 B
Ruby
18 lines
517 B
Ruby
require "rails_helper"
|
|
|
|
RSpec.describe DiscussionLock, type: :model do
|
|
let(:discussion_lock) { create(:discussion_lock) }
|
|
|
|
describe "relationships" do
|
|
it { is_expected.to belong_to(:article) }
|
|
it { is_expected.to belong_to(:locking_user) }
|
|
end
|
|
|
|
describe "validations" do
|
|
subject { discussion_lock }
|
|
|
|
it { is_expected.to validate_presence_of(:article_id) }
|
|
it { is_expected.to validate_presence_of(:locking_user_id) }
|
|
it { is_expected.to validate_uniqueness_of(:article_id) }
|
|
end
|
|
end
|