2016-12-06 11:50:48 -05:00
|
|
|
require 'spec_helper'
|
|
|
|
|
2018-07-05 02:32:05 -04:00
|
|
|
describe 'Edit group label' do
|
|
|
|
let(:user) { create(:user) }
|
|
|
|
let(:group) { create(:group) }
|
|
|
|
let(:label) { create(:group_label, group: group) }
|
2016-12-06 11:50:48 -05:00
|
|
|
|
2018-07-05 02:32:05 -04:00
|
|
|
before do
|
2016-12-06 11:50:48 -05:00
|
|
|
group.add_owner(user)
|
2017-06-21 19:44:10 -04:00
|
|
|
sign_in(user)
|
2016-12-06 11:50:48 -05:00
|
|
|
visit edit_group_label_path(group, label)
|
|
|
|
end
|
|
|
|
|
2018-07-05 02:32:05 -04:00
|
|
|
it 'update label with new title' do
|
2016-12-06 11:50:48 -05:00
|
|
|
fill_in 'label_title', with: 'new label name'
|
|
|
|
click_button 'Save changes'
|
|
|
|
|
|
|
|
expect(current_path).to eq(root_path)
|
|
|
|
expect(label.reload.title).to eq('new label name')
|
|
|
|
end
|
|
|
|
end
|