summaryrefslogtreecommitdiff
path: root/spec/features/dashboard/group_spec.rb
blob: 1d4b86ed4b480f26049c008affa51485ce833ba8 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
require 'spec_helper'

RSpec.describe 'Dashboard Group', feature: true do
  before do
    login_as(:user)
  end

  it 'creates new group', js: true do
    visit dashboard_groups_path
    click_link 'New group'
    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