Skip to content
Permalink
Browse files

Fix issues after version bump (#5439)

* Fix rubocop offenses

* Fix metrics query, use an array of strings
  • Loading branch information...
oriolgual committed Oct 22, 2019
1 parent 8584fd7 commit 0dc2fa83526cd3ddc858cbd326799761c586469a
@@ -47,6 +47,7 @@ module Admin
subject.call
expect(translated(post.title)).to eq title
end

it "updates the body" do
subject.call
expect(translated(post.body)).to eq body
@@ -9,12 +9,12 @@ $(() => {
const metricsParams = {};

const query = () => {
let metricsQuery = `metrics(names: [${metricsParams.names}], space_type: "${metricsParams.spaceType}", space_id: ${metricsParams.spaceId}) { name history { key value } }`;
let metricsQuery = `metrics(names: ${metricsParams.names}, space_type: "${metricsParams.spaceType}", space_id: ${metricsParams.spaceId}) { name history { key value } }`;
return {query: `{ ${metricsQuery} }`};
}

const parameterize = (metrics) => {
metricsParams.names = metrics.join(" ");
metricsParams.names = JSON.stringify(metrics || []);
metricsParams.spaceType = $("#metrics #metrics-space_type").val() || null;
metricsParams.spaceId = $("#metrics #metrics-space_id").val() || null;
}
@@ -47,16 +47,19 @@
expect(html).to have_css(".tags.tags--proposal")
expect(html).to have_content(translated(scope.name))
end

it "renders the subscope of a proposal" do
html = cell("decidim/tags", proposal_subscoped, context: { extra_classes: ["tags--proposal"] }).call
expect(html).to have_css(".tags.tags--proposal")
expect(html).to have_content(translated(subscope.name))
end

it "renders the scope of a meeting" do
html = cell("decidim/tags", meeting_scoped, context: { extra_classes: ["tags--meeting"] }).call
expect(html).to have_css(".tags.tags--meeting")
expect(html).to have_content(translated(scope.name))
end

it "renders the subscope of a meeting" do
html = cell("decidim/tags", meeting_subscoped, context: { extra_classes: ["tags--meeting"] }).call
expect(html).to have_css(".tags.tags--meeting")
@@ -70,6 +73,7 @@
expect(html).to have_css(".tags.tags--proposal")
expect(html).to have_content(translated(category.name))
end

it "renders the subcategory of a proposal" do
html = cell("decidim/tags", proposal_subcategorized, context: { extra_classes: ["tags--proposal"] }).call
expect(html).to have_css(".tags.tags--proposal")
@@ -81,6 +85,7 @@
expect(html).to have_css(".tags.tags--meeting")
expect(html).to have_content(translated(category.name))
end

it "renders the subcategory of a meeting" do
html = cell("decidim/tags", meeting_subcategorized, context: { extra_classes: ["tags--meeting"] }).call
expect(html).to have_css(".tags.tags--meeting")
@@ -95,6 +100,7 @@
expect(html).to have_content(translated(scope.name))
expect(html).to have_content(translated(category.name))
end

it "renders the scope and category of a meeting" do
html = cell("decidim/tags", meeting_scoped_categorized, context: { extra_classes: ["tags--meeting"] }).call
expect(html).to have_css(".tags.tags--meeting")
@@ -19,11 +19,13 @@ module Decidim
it "detected locale is empty" do
expect(controller.detect_locale.to_s).to be_empty
end

it "application uses default language" do
controller.switch_locale do
expect(I18n.locale.to_s).to eq(default_locale)
end
end

context "with alternate default locale" do
let(:default_locale) { alt_locale }

@@ -131,6 +131,7 @@ module Decidim
subject.set_index_condition(:create, true)
expect(subject).to be_index_on_create(nil)
end

it "does NOT index the resource if false is setted" do
subject.set_index_condition(:create, false)
expect(subject).not_to be_index_on_create(nil)
@@ -152,6 +153,7 @@ module Decidim
subject.set_index_condition(:update, true)
expect(subject).to be_index_on_update(nil)
end

it "does NOT index the resource if false is setted" do
subject.set_index_condition(:update, false)
expect(subject).not_to be_index_on_update(nil)
@@ -18,9 +18,11 @@ module Decidim
it "has different scope" do
expect(permission_action.matches?(:testing, :check, :result)).to be false
end

it "has different action" do
expect(permission_action.matches?(:test, :match, :result)).to be false
end

it "has different subject" do
expect(permission_action.matches?(:test, :check, :asdf)).to be false
end
@@ -67,6 +67,7 @@
expect(subject).to have_css(".author-data--small", count: 3)
end
end

it "renders the see_more link" do
within ".card__content" do
expect.to have_link(".collapsible-list__see-more")
@@ -80,6 +81,7 @@
it "renders the card with the .success class" do
expect(subject).to have_css(".card.success")
end

it "renders the open state" do
within ".card__text" do
expect(subject).to have_css(".success.card__text--status")
@@ -94,6 +96,7 @@
it "renders the card with the .alert class" do
expect(subject).to have_css(".card.alert")
end

it "renders the open state" do
within ".card__text" do
expect(subject).to have_css(".alert.card__text--status")
@@ -108,6 +111,7 @@
it "renders the card with the .secondary class" do
expect(subject).to have_css(".card.secondary")
end

it "renders the open state" do
within ".card__text" do
expect(subject).to have_css(".secondary.card__text--status")
@@ -30,6 +30,7 @@ module ContentParsers
let(:content) { nil }

it { is_expected.to eq("") }

it "has empty metadata" do
subject
expect(parser.metadata).to be_a(Decidim::ContentParsers::ProposalParser::Metadata)
@@ -41,6 +42,7 @@ module ContentParsers
let(:content) { "" }

it { is_expected.to eq("") }

it "has empty metadata" do
subject
expect(parser.metadata).to be_a(Decidim::ContentParsers::ProposalParser::Metadata)
@@ -52,6 +54,7 @@ module ContentParsers
let(:content) { "whatever content with @mentions and #hashes but no links." }

it { is_expected.to eq(content) }

it "has empty metadata" do
subject
expect(parser.metadata).to be_a(Decidim::ContentParsers::ProposalParser::Metadata)
@@ -81,6 +84,7 @@ module ContentParsers
end

it { is_expected.to eq("This content references proposal #{proposal.to_global_id}.") }

it "has metadata with the proposal" do
subject
expect(parser.metadata).to be_a(Decidim::ContentParsers::ProposalParser::Metadata)
@@ -95,6 +99,7 @@ module ContentParsers
end

it { is_expected.to eq(content) }

it "has metadata with the proposal" do
subject
expect(parser.metadata).to be_a(Decidim::ContentParsers::ProposalParser::Metadata)
@@ -114,6 +119,7 @@ module ContentParsers
end

it { is_expected.to eq("This content references the following proposals: #{proposal1.to_global_id}, #{proposal2.to_global_id} and #{proposal3.to_global_id}. Great?I like them!") }

it "has metadata with all linked proposals" do
subject
expect(parser.metadata).to be_a(Decidim::ContentParsers::ProposalParser::Metadata)
@@ -129,6 +135,7 @@ module ContentParsers
end

it { is_expected.to eq(content) }

it "has metadata with no reference to the proposal" do
subject
expect(parser.metadata).to be_a(Decidim::ContentParsers::ProposalParser::Metadata)
@@ -145,6 +152,7 @@ module ContentParsers
end

it { is_expected.to eq(content) }

it "has empty metadata" do
subject
expect(parser.metadata).to be_a(Decidim::ContentParsers::ProposalParser::Metadata)
@@ -161,6 +169,7 @@ module ContentParsers
end

it { is_expected.to eq("This content references proposal #{url}.") }

it "has empty metadata" do
subject
expect(parser.metadata).to be_a(Decidim::ContentParsers::ProposalParser::Metadata)
@@ -173,6 +182,7 @@ module ContentParsers
let(:content) { "This content references proposal ~#{proposal.id}." }

it { is_expected.to eq("This content references proposal #{proposal.to_global_id}.") }

it "has metadata with the proposal" do
subject
expect(parser.metadata).to be_a(Decidim::ContentParsers::ProposalParser::Metadata)
@@ -265,11 +265,13 @@
expect(page).to have_css("#request_#{user.id}")
end
end

it "shows the button to accept the request" do
within ".card.extra" do
expect(page).to have_css(".button.hollow.secondary.small", text: "Accept")
end
end

it "shows the button to reject the request" do
within ".card.extra" do
expect(page).to have_css(".icon--x")

0 comments on commit 0dc2fa8

Please sign in to comment.
You can’t perform that action at this time.