Sha256: a7633b8b70c22aab327ee85ec6ad8da9d9751f848ea584ee92298f2d1daded5e

Contents?: true

Size: 802 Bytes

Versions: 2

Compression:

Stored size: 802 Bytes

Contents

require 'spec_helper'

RSpec.configure do |c|
  Warden.test_mode!
end

describe "datastreams/upload.html.erb" do
  let(:object) { FactoryGirl.create(:item) }
  let(:user) { FactoryGirl.create(:user) }
  before { 
    object.permissions = [{type: 'user', name: user.email, access: 'edit'}]
    object.save
    login_as(user, :scope => :user, :run_callbacks => false) 
    visit fcrepo_admin.upload_object_datastream_path(object, "descMetadata")
  }
  after do
    user.delete
    object.delete
    Warden.test_reset!
  end
  it "should provide an upload form" do
    attach_file "file", File.join(Rails.root, "spec", "fixtures", "files", "descMetadata.xml")
    click_button I18n.t("fcrepo_admin.datastream.upload.submit")
    object.reload
    object.title.should == "Altered Test Component"
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
fcrepo_admin-0.4.1 spec/features/datastreams/upload.html.erb_spec.rb
fcrepo_admin-0.4.0 spec/features/datastreams/upload.html.erb_spec.rb