Skip to content

Commit

Permalink
Upgrade to latest version of curation_concerns
Browse files Browse the repository at this point in the history
  • Loading branch information
jcoyne committed Apr 7, 2016
1 parent 1d4b9e0 commit 45162a0
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 12 deletions.
18 changes: 10 additions & 8 deletions spec/controllers/collections_controller_spec.rb
Expand Up @@ -33,23 +33,25 @@

it "creates a Collection" do
expect {
post :create, collection: { title: "My First Collection ", description: "The Description\r\n\r\nand more" }
post :create, collection: { title: ["My First Collection "],
description: "The Description\r\n\r\nand more" }
}.to change { Collection.count }.by(1)
end

it "removes blank strings from params before creating Collection" do
expect {
post :create, collection: {
title: "My First Collection ", creator: [""] }
title: ["My First Collection "], creator: [""] }
}.to change { Collection.count }.by(1)
expect(assigns[:collection].title).to eq(["My First Collection "])
expect(assigns[:collection].creator).to eq([])
expect(assigns[:collection].title).to eq ["My First Collection "]
expect(assigns[:collection].creator).to eq []
end

context "with files I can access" do
it "creates a collection using only the accessible files" do
expect {
post :create, collection: { title: "My own Collection", description: "The Description\r\n\r\nand more" },
post :create, collection: { title: ["My own Collection"],
description: "The Description\r\n\r\nand more" },
batch_document_ids: [asset1.id, asset2.id, unowned_asset.id]
}.to change { Collection.count }.by(1)
collection = assigns(:collection)
Expand Down Expand Up @@ -108,9 +110,9 @@

it "removes blank strings from params before updating Collection metadata" do
put :update, id: collection, collection: {
title: "My Next Collection ", creator: [""] }
expect(assigns[:collection].title).to eq(["My Next Collection "])
expect(assigns[:collection].creator).to eq([])
title: ["My Next Collection "], creator: [""] }
expect(assigns[:collection].title).to eq ["My Next Collection "]
expect(assigns[:collection].creator).to eq []
end
end
end
Expand Down
4 changes: 2 additions & 2 deletions spec/features/collection_spec.rb
Expand Up @@ -24,8 +24,8 @@
# Creator is a multi-value field, so it should have button to add more fields
expect(page).to have_selector "div.collection_creator .input-append button.add"

# Title is a single-value field, so it should not have the adder button
expect(page).to_not have_selector "div.collection_title .input-append button.add"
# Title is a multi-value field, so it should have the add another button
expect(page).to have_selector "div.collection_title .input-append button.add"

fill_in('Title', with: title)
fill_in('Abstract or Summary', with: description)
Expand Down
Expand Up @@ -31,7 +31,7 @@
before do
stub_template 'shared/_title_bar.html.erb' => 'Title Bar'
stub_template 'shared/_citations.html.erb' => 'Citation'
render template: 'curation_concerns/file_sets/show.html.erb', layout: 'layouts/curation_concerns'
render
end
it 'shows the title' do
expect(rendered).to have_selector 'h1', text: 'My Title'
Expand Down
2 changes: 1 addition & 1 deletion sufia.gemspec
Expand Up @@ -18,7 +18,7 @@ Gem::Specification.new do |spec|
spec.version = Sufia::VERSION
spec.license = 'Apache2'

spec.add_dependency 'curation_concerns', '~> 0.12.0.pre1'
spec.add_dependency 'curation_concerns', '~> 0.12.0.pre4'
spec.add_dependency 'active-fedora', '~> 9.10'
spec.add_dependency 'hydra-works', '~> 0.7'
spec.add_dependency 'hydra-batch-edit', '~> 1.1'
Expand Down

0 comments on commit 45162a0

Please sign in to comment.