gitlab-org--gitlab-foss/spec/features/dashboard/group_spec.rb
Robert Speicher 2409acfa7f Merge branch 'master' into 'group-sort-dropdown-blank'
# Conflicts:
#   spec/features/dashboard/group_spec.rb
2017-10-09 12:52:51 +00:00

28 lines
719 B
Ruby

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('.btn-new').trigger('click')
new_path = 'Samurai'
new_description = 'Tokugawa Shogunate'
fill_in 'group_path', with: new_path
fill_in 'group_description', with: new_description
click_button 'Create group'
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)
end
end