Sha256: a32ba862703df80d3f90e4c8d37daa2140966841e0bcaadccf3adab61fe3603c
Contents?: true
Size: 906 Bytes
Versions: 41
Compression:
Stored size: 906 Bytes
Contents
# frozen_string_literal: true shared_examples "an amendment form" do let(:title) { "More sidewalks and less roads!" } let(:body) { "Everything would be better" } let(:emendation_params) do { title: title, body: body } end context "when everything is OK" do it { is_expected.to be_valid } end context "when there's no title" do let(:title) { nil } it { is_expected.to be_invalid } it "only adds errors to this field" do subject.valid? expect(subject.errors.keys).to eq [:title] end end context "when the title is too long" do let(:body) { "A" * 200 } it { is_expected.to be_invalid } end context "when the body is not etiquette-compliant" do let(:body) { "A" } it { is_expected.to be_invalid } end context "when there's no body" do let(:body) { nil } it { is_expected.to be_invalid } end end
Version data entries
41 entries across 41 versions & 1 rubygems