osem-fcy/spec/models/vote_spec.rb

18 lines
390 B
Ruby
Raw Normal View History

2019-04-03 18:51:07 +05:30
# frozen_string_literal: true
require 'spec_helper'
describe Vote do
let(:user) { create(:user) }
let(:event) { create(:event) }
let(:vote) { create(:vote, event: event, user: user) }
describe 'validation' do
2019-04-06 00:09:20 +05:30
it { is_expected.to validate_uniqueness_of(:user_id).scoped_to(:event_id) }
2019-04-03 18:51:07 +05:30
it 'has a valid factory' do
expect(build(:vote)).to be_valid
end
end
end