Bugfixing and several enhancements

* Added missing specs
* Removed models that were refactored previously
* Added simplecov when executing specs locally
* Fixed bug in poll model validation that was causing an 500 error.
This commit is contained in:
Juan Salvador Pérez García
2018-08-01 13:26:30 +02:00
parent 0e20247682
commit 5b5095b37b
11 changed files with 88 additions and 115 deletions

View File

@@ -47,6 +47,11 @@ feature 'Admin dashboard actions' do
expect(page).to have_content(action.title)
end
scenario 'Renders create form in case data is invalid' do
click_button 'Save'
expect(page).to have_content('errors prevented this Dashboard/Action from being saved.')
end
end
context 'when editing an action' do
@@ -64,6 +69,12 @@ feature 'Admin dashboard actions' do
expect(page).to have_content(title)
end
scenario 'Renders edit form in case data is invalid' do
fill_in 'dashboard_action_title', with: 'x'
click_button 'Save'
expect(page).to have_content('error prevented this Dashboard/Action from being saved.')
end
end
context 'when destroying an action' do
@@ -80,5 +91,15 @@ feature 'Admin dashboard actions' do
expect(page).not_to have_content(action.title)
end
scenario 'can not delete actions that have been executed', js: true do
_executed_action = create(:dashboard_executed_action, action: action)
page.accept_confirm do
click_link 'Delete'
end
expect(page).to have_content('Cannot delete record because dependent executed actions exist')
end
end
end