Sha256: bd2165f918652be5627073943028b5b4e20d855f78ae5c4c92e483741fac7960
Contents?: true
Size: 756 Bytes
Versions: 67
Compression:
Stored size: 756 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 } controller.stub(:after_update_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
67 entries across 67 versions & 1 rubygems