Commit 7a264568 authored by Benjamin Neff's avatar Benjamin Neff

Add checksums to assets in specs

parent 7ee8bfba
......@@ -54,13 +54,13 @@ describe ApplicationHelper, :type => :helper do
end
it 'includes jquery.js from asset pipeline' do
expect(helper.jquery_include_tag).to match(/jquery3\.js/)
expect(helper.jquery_include_tag).to match(/jquery3-[0-9a-f]{64}\.js/)
expect(helper.jquery_include_tag).not_to match(/jquery\.com/)
end
end
it 'inclues jquery_ujs.js' do
expect(helper.jquery_include_tag).to match(/jquery_ujs\.js/)
expect(helper.jquery_include_tag).to match(/jquery_ujs-[0-9a-f]{64}\.js/)
end
it "disables ajax caching" do
......
......@@ -10,11 +10,10 @@ describe AvatarPresenter do
it "returns the default images if no images set" do
@profile = FactoryGirl.create(:profile, person: alice.person)
@presenter = AvatarPresenter.new(@profile)
expect(@presenter.base_hash).to eq(
small: "/assets/user/default.png",
medium: "/assets/user/default.png",
large: "/assets/user/default.png"
)
expect(@presenter.base_hash.keys).to eq(%i[small medium large])
expect(@presenter.base_hash[:small]).to match(%r{/assets/user/default-[0-9a-f]{64}\.png})
expect(@presenter.base_hash[:medium]).to match(%r{/assets/user/default-[0-9a-f]{64}\.png})
expect(@presenter.base_hash[:large]).to match(%r{/assets/user/default-[0-9a-f]{64}\.png})
end
end
end
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment