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

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

  it 'creates new grpup' do
    visit dashboard_groups_path
    click_link 'New group'

    fill_in 'group_path', with: 'Samurai'
    fill_in 'group_description', with: 'Tokugawa Shogunate'
    click_button 'Create group'

    expect(current_path).to eq group_path(Group.find_by(name: 'Samurai'))
    expect(page).to have_content('Samurai')
    expect(page).to have_content('Tokugawa Shogunate')
  end
end