Pending example models minimal coverage (#23912)
This commit is contained in:
parent
7f4412eeeb
commit
506b16cf59
9 changed files with 128 additions and 17 deletions
|
@ -2,6 +2,31 @@
|
|||
|
||||
require 'rails_helper'
|
||||
|
||||
RSpec.describe Poll, type: :model do
|
||||
pending "add some examples to (or delete) #{__FILE__}"
|
||||
describe Poll do
|
||||
describe 'scopes' do
|
||||
let(:status) { Fabricate(:status) }
|
||||
let(:attached_poll) { Fabricate(:poll, status: status) }
|
||||
let(:not_attached_poll) do
|
||||
Fabricate(:poll).tap do |poll|
|
||||
poll.status = nil
|
||||
poll.save(validate: false)
|
||||
end
|
||||
end
|
||||
|
||||
describe 'attached' do
|
||||
it 'finds the correct records' do
|
||||
results = described_class.attached
|
||||
|
||||
expect(results).to eq([attached_poll])
|
||||
end
|
||||
end
|
||||
|
||||
describe 'unattached' do
|
||||
it 'finds the correct records' do
|
||||
results = described_class.unattached
|
||||
|
||||
expect(results).to eq([not_attached_poll])
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue