Skip to content

Commit

Permalink
Migrate group edit tests to Bootstrap
Browse files Browse the repository at this point in the history
  • Loading branch information
eduardoj committed Dec 6, 2018
1 parent 3a3c984 commit c1b9b8c
Show file tree
Hide file tree
Showing 3 changed files with 179 additions and 12 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -15,31 +15,28 @@
expect(page).to have_content('Incoming Reviews')
find('#group-members-tab').click
expect(page).to have_content('This group does not contain users.')
expect(page).to have_link('Edit group members')
expect(page).to have_link('Add User')

visit groups_path
expect(page).to have_content('Showing 1 to 2 of 2 entries')
within :xpath, "//tr[@id='group-test_group']" do
click_link(admin.login)
end
expect(current_path).to eq(user_show_path(admin))
expect(page).to have_current_path(user_show_path(admin))
end

scenario 'edit group' do
scenario 'add a user' do
login admin
visit groups_path

within :xpath, "//tr[@id='group-test_group_b']" do
click_link 'Edit Group'
click_link 'test_group_b'
end

expect(page).to have_content('Edit Group test_group_b')
# the interaction is a little complicated - so use js
page.execute_script('$("#members").tokenInput("add", {id: 1, name: "eisendieter"})')
click_button 'Save'

within 'form', text: 'Members:' do
expect(page).to have_content('eisendieter')
end
find('#group-members-tab').click
click_link 'Add User'
fill_in 'group_userid', with: 'eisendieter'
click_button('Accept')
expect(page).to have_content('eisendieter')
end
end
85 changes: 85 additions & 0 deletions src/api/spec/cassettes/Groups/add_a_user.yml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

85 changes: 85 additions & 0 deletions src/api/spec/cassettes/Groups/visit_group_page.yml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit c1b9b8c

Please sign in to comment.