Sha256: 0c60413088f8f17b1c5ef9bd11b2571944bfa780a2a2651f3362fc15a99cf5cd
Contents?: true
Size: 701 Bytes
Versions: 16
Compression:
Stored size: 701 Bytes
Contents
require 'spec_helper' describe Tenon::PostsController do routes { Tenon::Engine.routes } let(:user) do double( :staff? => true, :is_super_admin? => false, :is_admin? => true ) end let(:post) { double.as_null_object } before do controller.stub(:current_user) { user } controller.stub(:polymorphic_index_path) { posts_path } end describe 'PATCH update' do before do Tenon::Post.stub(:find) { double.as_null_object } end it "should instantiate the post_category_ids collection if it's empty" do patch :update, id: 1, post: { blah: 'blah' } expect(controller.params[:post][:post_category_ids]).to eq([]) end end end
Version data entries
16 entries across 16 versions & 1 rubygems