Skip to content
Extraits de code Groupes Projets
Non vérifiée Valider 7a264568 rédigé par Benjamin Neff's avatar Benjamin Neff
Parcourir les fichiers

Add checksums to assets in specs

parent 7ee8bfba
Aucune branche associée trouvée
Aucune étiquette associée trouvée
Aucune requête de fusion associée trouvée
...@@ -54,13 +54,13 @@ describe ApplicationHelper, :type => :helper do ...@@ -54,13 +54,13 @@ describe ApplicationHelper, :type => :helper do
end end
it 'includes jquery.js from asset pipeline' do 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/) expect(helper.jquery_include_tag).not_to match(/jquery\.com/)
end end
end end
it 'inclues jquery_ujs.js' do 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 end
it "disables ajax caching" do it "disables ajax caching" do
......
...@@ -10,11 +10,10 @@ describe AvatarPresenter do ...@@ -10,11 +10,10 @@ describe AvatarPresenter do
it "returns the default images if no images set" do it "returns the default images if no images set" do
@profile = FactoryGirl.create(:profile, person: alice.person) @profile = FactoryGirl.create(:profile, person: alice.person)
@presenter = AvatarPresenter.new(@profile) @presenter = AvatarPresenter.new(@profile)
expect(@presenter.base_hash).to eq( expect(@presenter.base_hash.keys).to eq(%i[small medium large])
small: "/assets/user/default.png", expect(@presenter.base_hash[:small]).to match(%r{/assets/user/default-[0-9a-f]{64}\.png})
medium: "/assets/user/default.png", expect(@presenter.base_hash[:medium]).to match(%r{/assets/user/default-[0-9a-f]{64}\.png})
large: "/assets/user/default.png" expect(@presenter.base_hash[:large]).to match(%r{/assets/user/default-[0-9a-f]{64}\.png})
)
end end
end end
end end
0% Chargement en cours ou .
You are about to add 0 people to the discussion. Proceed with caution.
Terminez d'abord l'édition de ce message.
Veuillez vous inscrire ou vous pour commenter