Sha256: c63b711c83b575b7e633650507a0fa8213292e91e9731fcb9318be6b94a66c3a

Contents?: true

Size: 740 Bytes

Versions: 2

Compression:

Stored size: 740 Bytes

Contents

require File.dirname(__FILE__) + '/../../spec_helper'

describe Admin::ResourcesController do
  before do
    @request.session = { :user => users(:tobi).id }
  end

  it "test_index" do
    get :index
    assert_response :success
    assert_template 'index'
    assert_template_has 'resources'
    assert_not_nil assigns(:resources)
  end

  it "test_destroy" do
    res_id = resources(:resource1).id
    assert_not_nil Resource.find(res_id)

    get :destroy, :id => res_id
    assert_response :success
    assert_template 'destroy'
    assert_not_nil assigns(:file)

    post :destroy, :id => res_id
    response.should redirect_to(:action => 'index')
  end

  it "test_upload" do
    # unsure how to test upload constructs :'(
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
typo-5.4.1 spec/controllers/admin/resources_controller_spec.rb
typo-5.4 spec/controllers/admin/resources_controller_spec.rb