Sha256: ddf81a86e998cf16b55ab4a2486d955a8391a7ca9a87b6c9fbbf88ab38dd0e79
Contents?: true
Size: 986 Bytes
Versions: 11
Compression:
Stored size: 986 Bytes
Contents
require 'test_helper' class Cms::PhotosControllerTest < ActionController::TestCase def setup @person = personnel :one @photo = photos :one end context "with personnel as parent" do context "on get to :index" do setup do get :index, :personnel_id => 1 end should respond_with :success should render_template "index" should assign_to :photos should assign_to :personnel should "scope photos to personnel" do assert assigns(:photos).all? { |photo| photo.personnel.id == 1 } end end context "on post to :create" do setup do post :create, :personnel_id => 1, :photo => {} end should redirect_to('cms_personnel_photo_path') { cms_personnel_photo_path(@person, assigns(:photo)) } should assign_to :photo should assign_to :personnel should "scope photo to personel" do assert personnel(:one), assigns(:photo).personnel end end end end
Version data entries
11 entries across 11 versions & 3 rubygems