diff --git a/spec/factories/forumer.rb b/spec/factories/forumer.rb new file mode 100644 index 0000000..50988a3 --- /dev/null +++ b/spec/factories/forumer.rb @@ -0,0 +1,7 @@ +FactoryGirl.define do + factory :forumer do + forum + group + access Forumer::ACCESS_TOPIC + end +end diff --git a/spec/models/forumer_spec.rb b/spec/models/forumer_spec.rb new file mode 100644 index 0000000..7c04f29 --- /dev/null +++ b/spec/models/forumer_spec.rb @@ -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