2019-07-25 01:24:42 -04:00
|
|
|
# frozen_string_literal: true
|
|
|
|
|
2017-01-04 05:27:29 -05:00
|
|
|
require 'spec_helper'
|
|
|
|
|
2017-06-29 00:13:10 -04:00
|
|
|
RSpec.describe 'Dashboard Group' do
|
2017-01-04 05:27:29 -05:00
|
|
|
before do
|
2017-06-21 19:44:10 -04:00
|
|
|
sign_in(create(:user))
|
2017-01-04 05:27:29 -05:00
|
|
|
end
|
|
|
|
|
2017-10-06 09:42:01 -04:00
|
|
|
it 'defaults sort dropdown to last created' do
|
|
|
|
visit dashboard_groups_path
|
|
|
|
|
|
|
|
expect(page).to have_button('Last created')
|
|
|
|
end
|
|
|
|
|
2017-10-03 04:35:01 -04:00
|
|
|
it 'creates new group', :js do
|
2017-01-04 05:27:29 -05:00
|
|
|
visit dashboard_groups_path
|
2021-03-01 07:11:29 -05:00
|
|
|
find('[data-testid="new-group-button"]').click
|
2021-05-26 20:10:40 -04:00
|
|
|
click_link 'Create group'
|
|
|
|
|
2018-10-30 12:23:47 -04:00
|
|
|
new_name = 'Samurai'
|
2017-01-04 05:27:29 -05:00
|
|
|
|
2018-10-30 12:23:47 -04:00
|
|
|
fill_in 'group_name', with: new_name
|
2017-01-04 05:27:29 -05:00
|
|
|
click_button 'Create group'
|
|
|
|
|
2018-10-30 12:23:47 -04:00
|
|
|
expect(current_path).to eq group_path(Group.find_by(name: new_name))
|
|
|
|
expect(page).to have_content(new_name)
|
2017-01-04 05:27:29 -05:00
|
|
|
end
|
|
|
|
end
|