2017-01-04 05:27:29 -05:00
|
|
|
require 'spec_helper'
|
|
|
|
|
|
|
|
RSpec.describe 'Dashboard Group', feature: true do
|
|
|
|
before do
|
|
|
|
login_as(:user)
|
|
|
|
end
|
|
|
|
|
2017-03-12 11:22:00 -04:00
|
|
|
it 'creates new group', js: true do
|
2017-01-04 05:27:29 -05:00
|
|
|
visit dashboard_groups_path
|
2017-05-08 16:08:39 -04:00
|
|
|
find('.btn-new').trigger('click')
|
2017-03-12 11:22:00 -04:00
|
|
|
new_path = 'Samurai'
|
|
|
|
new_description = 'Tokugawa Shogunate'
|
2017-01-04 05:27:29 -05:00
|
|
|
|
2017-03-12 11:22:00 -04:00
|
|
|
fill_in 'group_path', with: new_path
|
|
|
|
fill_in 'group_description', with: new_description
|
2017-01-04 05:27:29 -05:00
|
|
|
click_button 'Create group'
|
|
|
|
|
2017-03-12 11:22:00 -04:00
|
|
|
expect(current_path).to eq group_path(Group.find_by(name: new_path))
|
|
|
|
expect(page).to have_content(new_path)
|
|
|
|
expect(page).to have_content(new_description)
|
2017-01-04 05:27:29 -05:00
|
|
|
end
|
|
|
|
end
|