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