serializations_controller_spec.rb revision bdc69d2e103b81dfabf3965a968cad610feecfff
0cb2e8eb55e70f8ebe1e8349bdf49e4cbe5d8834Timo Sirainenrequire 'spec_helper'
0cb2e8eb55e70f8ebe1e8349bdf49e4cbe5d8834Timo Sirainen let!(:language) { FactoryGirl.create :language, user: user }
0cb2e8eb55e70f8ebe1e8349bdf49e4cbe5d8834Timo Sirainen let!(:serial) { FactoryGirl.create :serialization, language: language }
0cb2e8eb55e70f8ebe1e8349bdf49e4cbe5d8834Timo Sirainen let!(:serial_from_db) { Serialization.find_by_name('test132') }
0cb2e8eb55e70f8ebe1e8349bdf49e4cbe5d8834Timo Sirainen let!(:serial_from_db) { Serialization.find_by_name('test4325') }
9aa52288a4b53186d81b0ec9afa7d9e0a8ee8753Timo Sirainen expect(serial_from_db.mimetype).to eq('texttext')
659fe5d24825b160cae512538088020d97a60239Timo Sirainen expect(Serialization.find_by_id(serial.id)).to be_nil
9aa52288a4b53186d81b0ec9afa7d9e0a8ee8753Timo Sirainen let!(:serial_from_db) { Serialization.find_by_name('test132') }
e68309fcfa2eaa88217fd51e7b4900fc9c20ef5dTimo Sirainen let!(:serial_from_db) { Serialization.find_by_name('test4325') }
e68309fcfa2eaa88217fd51e7b4900fc9c20ef5dTimo Sirainen expect(serial_from_db.mimetype).to eq('texttext')
e68309fcfa2eaa88217fd51e7b4900fc9c20ef5dTimo Sirainen expect(Serialization.find_by_id(serial.id)).to be_nil
e68309fcfa2eaa88217fd51e7b4900fc9c20ef5dTimo Sirainen get :show, id: serial.id, language_id: language.id
9aa52288a4b53186d81b0ec9afa7d9e0a8ee8753Timo Sirainen expect(Serialization.find_by_name('test2')).to be_nil
8fcff4c5b52f24d9c681805fdf06b486f1d0fcbeTimo Sirainen expect(Serialization.find_by_name('test2')).to be_nil