Add universes to content feature tests

This commit is contained in:
Robert Richter 2016-10-01 17:18:52 -05:00
parent d1412624ae
commit cd6bc7c648
No known key found for this signature in database
GPG Key ID: BEC39BF873A0103B
2 changed files with 6 additions and 4 deletions

View File

@ -15,6 +15,7 @@ Feature: Character sheets
| character |
| location |
| item |
| universe |
Scenario Outline: I change my content's name
Given I have created a <content_type>
@ -26,3 +27,4 @@ Feature: Character sheets
| character |
| location |
| item |
| universe |

View File

@ -7,21 +7,21 @@ When 'I am logged-in' do
click_button 'Log in'
end
When /^I create a (character|location|item)$/ do |model|
When /^I create a (character|location|item|universe)$/ do |model|
visit new_polymorphic_path(model)
fill_in "#{model}_name", with: 'My new content'
click_on "Create #{model.titlecase}"
end
Then /^that (character|location|item) should be saved$/ do |model|
Then /^that (character|location|item|universe) should be saved$/ do |model|
expect(@user.send(model.pluralize).length).to eq(1)
end
Given /^I have created a (character|location|item)$/ do |model|
Given /^I have created a (character|location|item|universe)$/ do |model|
@model = create(model.to_sym, user: @user)
end
When /^I change my (character|location|item)\'s name$/ do |model|
When /^I change my (character|location|item|universe)\'s name$/ do |model|
visit polymorphic_path(@model)
click_on "Edit this #{model}"
fill_in "#{model}_name", with: 'My changed name'