Last active
August 29, 2015 14:18
-
-
Save jasononaquest/07ffbb2f761ccfc2dd1e to your computer and use it in GitHub Desktop.
copy_list_spec.rb
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'rails_helper' | |
require './app/services/copy_list' | |
describe CopyList, type: :service do | |
describe 'given an existing list and a list name' do | |
let(:list) { list = List.create(name: 'my list') } | |
let(:category) { Category.create(name: 'my category', list: list) } | |
let!(:item) { Item.create(name: 'my item', category: category) | |
let(:new_name) { 'my new list' } | |
subject(:new_list) { CopyList.new(list, new_name).call } | |
it 'copies a list using the new name' do | |
expect(new_list.name).to eq 'my new list' | |
end | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment