diff options
author | Tim Zallmann <tzallmann@gitlab.com> | 2017-06-07 22:11:43 +0200 |
---|---|---|
committer | Tim Zallmann <tzallmann@gitlab.com> | 2017-06-07 22:11:43 +0200 |
commit | c7bf2bfdaaa2f1aaff0cb1118260db744abb5633 (patch) | |
tree | a79b982dc5cfc2d1b0b0c0b96be82f40b6d07ea7 | |
parent | f20337ca8ef39bf9907a09e23111262d0dfa4e49 (diff) | |
download | gitlab-ce-c7bf2bfdaaa2f1aaff0cb1118260db744abb5633.tar.gz |
Converting Tests to Spec Tests
-rw-r--r-- | spec/features/explore/new_menu_spec.rb | 58 |
1 files changed, 58 insertions, 0 deletions
diff --git a/spec/features/explore/new_menu_spec.rb b/spec/features/explore/new_menu_spec.rb new file mode 100644 index 00000000000..8fc8d0e8975 --- /dev/null +++ b/spec/features/explore/new_menu_spec.rb @@ -0,0 +1,58 @@ +require 'spec_helper' + +describe 'Top Plus Menu', :js, :feature do + let!(:user) { create :user } + let!(:group) { create(:group) } + let!(:public_group) { create(:group, :public) } + let!(:private_group) { create(:group, :private) } + let!(:empty_project) { create(:empty_project, group: public_group) } + + before do + group.add_owner(user) + + login_as(user) + + visit explore_groups_path + end + + context 'used by full user' do + before do + login_as :user + end + + scenario 'click on New project shows new project page' + visit root_dashboard_path + + click_topmenuitem("New project") + + expect(page).to have_content('Project path') + expect(page).to have_content('Project name') + end + + scenario 'click on New group shows new group page' + visit root_dashboard_path + + click_topmenuitem("New group") + + expect(page).to have_content('Group path') + expect(page).to have_content('Group name') + end + + scenario 'click on New group shows new group page' + visit root_dashboard_path + + click_topmenuitem("New snippet") + + expect(page).to have_content('New Snippet') + expect(page).to have_content('Title') + end + end + + def click_topmenuitem(item_name) + page.within '.header-content' do + find('.header-new-dropdown-toggle').trigger('click') + expect(page).to have_selector('.header-new.dropdown.open', count: 1) + click_link item_name + end + end +end |