Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- require 'spec_helper'
- describe Book do
- let(:book) { described_class.new(file_name: 'QAZ') }
- describe '#file_url' do
- it 'returns file url' do
- expect(book.file_url).to eq("/system/qa/QAZ")
- end
- end
- describe '#delete_file' do
- before do
- Time.stub(:now).and_return(Time.mktime(1970,1,1))
- book.delete_file
- end
- it 'resets filename' do
- expect(book.reload).to be_nil
- end
- it 'changes file_destroye_at' do
- expect(book.reload).to eq(Time.mktime(1970,1,1))
- end
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement