Skip to content

Commit

Permalink
Save the link color.
Browse files Browse the repository at this point in the history
  • Loading branch information
jcoyne committed Apr 6, 2017
1 parent 3e70a71 commit c623ef5
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 0 deletions.
1 change: 1 addition & 0 deletions app/forms/hyrax/forms/admin/appearance.rb
Expand Up @@ -75,6 +75,7 @@ def primary_button_focus_border_color
def update!
update_block('header_background_color', attributes[:header_background_color])
update_block('header_text_color', attributes[:header_text_color])
update_block('link_color', attributes[:link_color])
update_block('footer_link_color', attributes[:footer_link_color])
update_block('primary_button_background_color', attributes[:primary_button_background_color])
end
Expand Down
18 changes: 18 additions & 0 deletions spec/forms/hyrax/forms/admin/appearance_spec.rb
@@ -0,0 +1,18 @@
require 'spec_helper'

RSpec.describe Hyrax::Forms::Admin::Appearance do
let(:form) { described_class.new({}) }

describe "update!" do
let(:block) { instance_double(ContentBlock) }

before do
allow(ContentBlock).to receive(:find_or_create_by).and_return(block)
end

it "calls update block 5 times" do
expect(block).to receive(:update!).exactly(5).times
form.update!
end
end
end

0 comments on commit c623ef5

Please sign in to comment.