Sha256: 8723c16f3d6670671816a1787ff794e6611d8d1838e8dd21a55b255a7815e15b

Contents?: true

Size: 811 Bytes

Versions: 4

Compression:

Stored size: 811 Bytes

Contents

require 'spec_helper'

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

describe "datastreams/upload.html.erb" do
  let(:object) { FactoryGirl.create(:content_model) }
  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

4 entries across 4 versions & 1 rubygems

Version Path
fcrepo_admin-0.3.5 spec/features/datastreams/upload.html.erb_spec.rb
fcrepo_admin-0.3.4 spec/features/datastreams/upload.html.erb_spec.rb
fcrepo_admin-0.3.3 spec/features/datastreams/upload.html.erb_spec.rb
fcrepo_admin-0.3.2 spec/features/datastreams/upload.html.erb_spec.rb