Skip to content

Commit

Permalink
Merge pull request consuldemocracy#3864 from consul/fix_random_titles
Browse files Browse the repository at this point in the history
Avoid invalid random titles in dashboard specs
  • Loading branch information
javierm authored Nov 19, 2019
2 parents 32cee4c + 9195229 commit 2ab8900
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 5 deletions.
5 changes: 2 additions & 3 deletions spec/features/admin/dashboard/actions_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,6 @@

context "when editing an action" do
let!(:action) { create :dashboard_action }
let(:title) { Faker::Lorem.sentence }

before do
visit admin_dashboard_actions_path
Expand All @@ -79,10 +78,10 @@
end

scenario "Updates the action" do
fill_in "dashboard_action_title", with: title
fill_in "dashboard_action_title", with: "Great action!"
click_button "Save"

expect(page).to have_content(title)
expect(page).to have_content "Great action!"
end

scenario "Renders edit form in case data is invalid" do
Expand Down
3 changes: 1 addition & 2 deletions spec/models/dashboard/action_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,14 @@
describe Dashboard::Action do
subject do
build :dashboard_action,
title: title,
title: "Take action!",
description: description,
day_offset: day_offset,
required_supports: required_supports,
request_to_administrators: request_to_administrators,
action_type: action_type
end

let(:title) { Faker::Lorem.sentence }
let(:description) { Faker::Lorem.sentence }
let(:day_offset) { 0 }
let(:required_supports) { 0 }
Expand Down

0 comments on commit 2ab8900

Please sign in to comment.