* Modify sample_application.yml and write test * Add ahrefs verification * Add some tests around model validations * Indent an end * Add a few tests * Add tests and reserved words * Fix live articles spec typo * Modify ga_events_controller
28 lines
642 B
Ruby
28 lines
642 B
Ruby
require "rails_helper"
|
|
|
|
RSpec.describe Block, type: :model do
|
|
|
|
it "creates processed_html after publishd!" do
|
|
user = create(:user)
|
|
user.add_role(:super_admin)
|
|
block = Block.new
|
|
block.input_html = "hello"
|
|
block.user_id = user.id
|
|
block.publish!
|
|
expect(block.processed_html).to eq("hello")
|
|
end
|
|
|
|
it "is not valid without user" do
|
|
block = Block.new
|
|
block.input_html = "hello"
|
|
expect(block).not_to be_valid
|
|
end
|
|
|
|
it "is not valid non-admin user" do
|
|
user = create(:user)
|
|
block = Block.new
|
|
block.user_id = user.id
|
|
block.input_html = "hello"
|
|
expect(block).not_to be_valid
|
|
end
|
|
end
|