Sha256: 1a2218e56e13bf32158bd16f28bf711cd6c2cc58a05ec403c1cbb7603e3f80e2

Contents?: true

Size: 701 Bytes

Versions: 4

Compression:

Stored size: 701 Bytes

Contents

require 'spec_helper'

describe FamilyGallery::PicturesController do
  let(:group) { create :group }
  let(:admin) { create :admin }

  routes { FamilyGallery::Engine.routes }

  before do
    sign_in admin
  end

  it "#create" do
    post :create, picture: {title: "Test title", description: "Test test", image: fixture_file_upload(Rails.root.join('..', '..', 'spec', 'test_pictures', 'sigrid.jpg'), "image/jpeg")}, group_id: group.id
    last_picture = assigns(:picture)
    last_picture.errors.to_a.should eq []
    response.should redirect_to last_picture
    last_picture.width.should_not eq nil
    last_picture.groups.should eq [group]
    last_picture.user_uploaded.should eq admin
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
family_gallery-0.0.8 spec/controllers/family_gallery/pictures_controller_spec.rb
family_gallery-0.0.7 spec/controllers/family_gallery/pictures_controller_spec.rb
family_gallery-0.0.6 spec/controllers/family_gallery/pictures_controller_spec.rb
family_gallery-0.0.5 spec/controllers/family_gallery/pictures_controller_spec.rb