Sha256: 8031730aa2992463f8d31fcb324e6584bf4008ac229524234adbd7d583952577
Contents?: true
Size: 971 Bytes
Versions: 11
Compression:
Stored size: 971 Bytes
Contents
# frozen_string_literal: true require "spec_helper" module Decidim module Results describe ResultsController, type: :controller do routes { Decidim::Results::Engine.routes } before do @request.env["decidim.current_organization"] = feature.organization @request.env["decidim.current_feature"] = feature end describe "results" do let(:titles) { %w(Biure Atque Delectus Quia Fuga) } let(:feature) { create(:result_feature) } let(:results_count) { titles.size } it "returns a collection of results ordered by title" do Array.new(results_count) do |n| title = {} title[I18n.locale.to_s] = titles[n] create(:result, title: title, feature: feature) end results = controller.send(:results) expect(results.pluck(:title).map { |title| title[I18n.locale.to_s] }).to eq(titles.sort) end end end end end
Version data entries
11 entries across 11 versions & 1 rubygems