mirror of
https://github.com/discourse/discourse.git
synced 2024-12-16 04:03:46 +08:00
b3d769ff4f
update rspec syntax to v3 change syntax to rspec v3 oops. fix typo mailers classes with rspec3 syntax helpers with rspec3 syntax jobs with rspec3 syntax serializers with rspec3 syntax views with rspec3 syntax support to rspec3 syntax category spec with rspec3 syntax
19 lines
544 B
Ruby
19 lines
544 B
Ruby
require 'spec_helper'
|
|
require_dependency 'badge'
|
|
|
|
describe Badge do
|
|
it { is_expected.to belong_to(:badge_type) }
|
|
it { is_expected.to belong_to(:badge_grouping) }
|
|
it { is_expected.to have_many(:user_badges).dependent(:destroy) }
|
|
|
|
it { is_expected.to validate_presence_of(:name) }
|
|
it { is_expected.to validate_presence_of(:badge_type) }
|
|
it { is_expected.to validate_uniqueness_of(:name) }
|
|
|
|
it 'has a valid system attribute for new badges' do
|
|
expect(Badge.create!(name: "test", badge_type_id: 1).system?).to be false
|
|
end
|
|
|
|
end
|
|
|