Skip to content

Commit

Permalink
Merge pull request #3176 from tulibraries/MAN-1352-disassociate-polic…
Browse files Browse the repository at this point in the history
…ies-from-groups-spaces

Man 1352 disassociate policies from groups spaces
  • Loading branch information
nomadicoder authored Dec 15, 2023
2 parents be927f1 + 562338a commit b555023
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 20 deletions.
21 changes: 1 addition & 20 deletions app/views/spaces/show.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,7 @@
</div>
<% end %>

<% if @space.policies.present? %>
<div class="col-12 col-lg-6">
<% else %>
<div class="col-12 col-lg-9">
<% end %>
<div class="col-12 col-lg-9">

<%= render "secondary_covid_alert" if @header_alert.present? %>

Expand Down Expand Up @@ -62,21 +58,6 @@
<%= image_tag @space.custom_image(1000,600), class: "decorative", alt: "" %>
</div>
<% end %>

<div class="col-12 col-lg-3 rightside-space">
<% if @space.policies.present? %>
<div class="related-policies">
<h2><%= t("manifold.buildings.show.related_policies") %></h2>
<ul>
<% @space.policies.each do |policy| %>
<li><%= link_to policy.name, policy_path(policy) %></li>
<li class="print-only dark"><%= [request.base_url, policy_path(policy)].join %></li>
<% end %>
</ul>
</div>
<% end %>
</div>

</div>
</div>
</div>
Expand Down
1 change: 1 addition & 0 deletions spec/factories/spaces.rb
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
File.open(Rails.root.join("spec/fixtures/charles.jpg")),
filename: "charles.jpg",
content_type: "image/jpeg")
space.image.analyze
end
end
end
Expand Down
22 changes: 22 additions & 0 deletions spec/views/spaces/show.html.erb_spec.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
# frozen_string_literal: true

require "rails_helper"

RSpec.describe "spaces/show.html.erb", type: :view do

let(:space) { FactoryBot.create(:space, :with_image) }

before(:each) do
view.lookup_context.prefixes << "application"
assign(:space, space)
end


describe "page displays image" do
it "uses the imageable concern" do
render
expect(rendered).to match(space.name)
end
end

end

0 comments on commit b555023

Please sign in to comment.