mirror of
https://github.com/ENSL/ensl.org.git
synced 2025-02-05 07:51:18 +00:00
Added initial forumer test
This commit is contained in:
parent
c9a0dd10b1
commit
25f184aeb0
2 changed files with 34 additions and 0 deletions
7
spec/factories/forumer.rb
Normal file
7
spec/factories/forumer.rb
Normal file
|
@ -0,0 +1,7 @@
|
||||||
|
FactoryGirl.define do
|
||||||
|
factory :forumer do
|
||||||
|
forum
|
||||||
|
group
|
||||||
|
access Forumer::ACCESS_TOPIC
|
||||||
|
end
|
||||||
|
end
|
27
spec/models/forumer_spec.rb
Normal file
27
spec/models/forumer_spec.rb
Normal file
|
@ -0,0 +1,27 @@
|
||||||
|
# == Schema Information
|
||||||
|
#
|
||||||
|
# Table name: forums
|
||||||
|
#
|
||||||
|
# id :integer not null, primary key
|
||||||
|
# title :string(255)
|
||||||
|
# description :string(255)
|
||||||
|
# category_id :integer
|
||||||
|
# created_at :datetime
|
||||||
|
# updated_at :datetime
|
||||||
|
# position :integer
|
||||||
|
#
|
||||||
|
|
||||||
|
require "spec_helper"
|
||||||
|
|
||||||
|
describe Forumer do
|
||||||
|
describe "create" do
|
||||||
|
let(:forumer) { build :forumer }
|
||||||
|
|
||||||
|
it "creates a new forumer" do
|
||||||
|
expect(forumer.valid?).to eq(true)
|
||||||
|
expect do
|
||||||
|
forumer.save!
|
||||||
|
end.to change(Forumer, :count).by(1)
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
Loading…
Reference in a new issue