gitlab-org--gitlab-foss/spec/features/dashboard/group_spec.rb

28 lines
615 B
Ruby
Raw Normal View History

# frozen_string_literal: true
require 'spec_helper'
RSpec.describe 'Dashboard Group' do
before do
sign_in(create(:user))
end
it 'defaults sort dropdown to last created' do
visit dashboard_groups_path
expect(page).to have_button('Last created')
end
it 'creates new group', :js do
visit dashboard_groups_path
find('[data-testid="new-group-button"]').click
new_name = 'Samurai'
fill_in 'group_name', with: new_name
click_button 'Create group'
expect(current_path).to eq group_path(Group.find_by(name: new_name))
expect(page).to have_content(new_name)
end
end