Add checksums to assets in specs

This commit is contained in:
Benjamin Neff 2017-07-30 05:21:33 +02:00
parent 7ee8bfbac4
commit 7a26456875
No known key found for this signature in database
GPG key ID: 971464C3F1A90194
2 changed files with 6 additions and 7 deletions

View file

@ -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

View file

@ -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