Well removing mods#author was way easier than I was expecting

master
Zequez 2015-08-07 06:48:40 -03:00
parent 013572c1d9
commit 5fcbeab0c9
3 changed files with 5 additions and 5 deletions

View File

@ -23,7 +23,7 @@ class Mod < ActiveRecord::Base
### Relationships
#################
belongs_to :author, class_name: 'User' # Deprecated, but don't remove it yet tons of tests break
# belongs_to :author, class_name: 'User' # Deprecated, but don't remove it yet tons of tests break
belongs_to :owner, class_name: 'User', foreign_key: :author_id
belongs_to :game_version_start, class_name: 'GameVersion'
belongs_to :game_version_end, class_name: 'GameVersion'

View File

@ -59,7 +59,7 @@ feature 'Modder creates a new mod' do
expect(mod.name).to eq 'Super Mod'
expect(mod.info_json_name).to eq 'super mod'
expect(mod.categories).to match_array [@category]
expect(mod.author).to eq @user
expect(mod.owner).to eq @user
end
scenario 'user submits a form without any mod version', js: true do
@ -72,7 +72,7 @@ feature 'Modder creates a new mod' do
mod = Mod.first
expect(mod.name).to eq 'Super Mod'
expect(mod.categories).to match_array [@category]
expect(mod.author).to eq @user
expect(mod.owner).to eq @user
end
end
@ -155,7 +155,7 @@ feature 'Modder creates a new mod' do
expect(mod.forum_url).to eq 'http://www.factorioforums.com/forum/viewtopic.php?f=14&t=5971&sid=1786856d6a687e92f6a12ad9425aeb9e'
expect(mod.official_url).to eq 'http://www.factorioforums.com/'
expect(mod.summary).to eq 'This is a small mod for testing'
expect(mod.author).to eq @user
expect(mod.owner).to eq @user
end

View File

@ -101,7 +101,7 @@ describe User, :type => :model do
describe 'deletion' do
it 'should blank the author_id of the mods belonging to this user if the user deletes the account' do
user = create :user
mod = create :mod, author: user
mod = create :mod, owner: user
expect(mod.author_id).to eq user.id
user.destroy
mod.reload