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