Fix some update_attributes in tests only on next-minor
These were already fixed on develop in another branch but were never backported, so lets do that now.
This commit is contained in:
parent
3c4da76be5
commit
2e3bd14a09
4 changed files with 15 additions and 15 deletions
|
|
@ -18,13 +18,13 @@ end
|
|||
|
||||
Given /^a user named "([^\"]*)" with email "([^\"]*)"$/ do |name, email|
|
||||
first, last = name.split
|
||||
user = create_user(:email => email, :username => "#{first}_#{last}")
|
||||
user.profile.update_attributes!(:first_name => first, :last_name => last) if first
|
||||
user = create_user(email: email, username: "#{first}_#{last}")
|
||||
user.profile.update!(first_name: first, last_name: last) if first
|
||||
end
|
||||
|
||||
Given /^a nsfw user with email "([^\"]*)"$/ do |email|
|
||||
user = create_user(:email => email)
|
||||
user.profile.update_attributes(:nsfw => true)
|
||||
user = create_user(email: email)
|
||||
user.profile.update(nsfw: true)
|
||||
end
|
||||
|
||||
Given /^a moderator with email "([^\"]*)"$/ do |email|
|
||||
|
|
|
|||
|
|
@ -203,7 +203,7 @@ describe Person, :type => :model do
|
|||
describe "delegating" do
|
||||
it "delegates last_name to the profile" do
|
||||
expect(@person.last_name).to eq(@person.profile.last_name)
|
||||
@person.profile.update_attributes(:last_name => "Heathers")
|
||||
@person.profile.update(last_name: "Heathers")
|
||||
expect(@person.reload.last_name).to eq("Heathers")
|
||||
end
|
||||
end
|
||||
|
|
@ -370,18 +370,18 @@ describe Person, :type => :model do
|
|||
end
|
||||
|
||||
describe "#first_name" do
|
||||
it 'returns username if first_name is not present in profile' do
|
||||
alice.person.profile.update_attributes(:first_name => "")
|
||||
it "returns username if first_name is not present in profile" do
|
||||
alice.person.profile.update(first_name: "")
|
||||
expect(alice.person.first_name).to eq(alice.username)
|
||||
end
|
||||
|
||||
it 'returns first words in first_name if first_name is present' do
|
||||
alice.person.profile.update_attributes(:first_name => "First Mid Last")
|
||||
it "returns first words in first_name if first_name is present" do
|
||||
alice.person.profile.update(first_name: "First Mid Last")
|
||||
expect(alice.person.first_name).to eq("First Mid")
|
||||
end
|
||||
|
||||
it 'returns first word in first_name if first_name is present' do
|
||||
alice.person.profile.update_attributes(:first_name => "Alice")
|
||||
it "returns first word in first_name if first_name is present" do
|
||||
alice.person.profile.update(first_name: "Alice")
|
||||
expect(alice.person.first_name).to eq("Alice")
|
||||
end
|
||||
end
|
||||
|
|
@ -591,7 +591,7 @@ describe Person, :type => :model do
|
|||
end
|
||||
|
||||
it "handles broken keys and returns nil" do
|
||||
@person.update_attributes(serialized_public_key: "broken")
|
||||
@person.update(serialized_public_key: "broken")
|
||||
expect(@person.public_key).to be_nil
|
||||
end
|
||||
end
|
||||
|
|
|
|||
|
|
@ -26,7 +26,7 @@ describe Reshare, type: :model do
|
|||
reshare1 = FactoryGirl.create(:reshare, author: alice.person)
|
||||
reshare2 = FactoryGirl.create(:reshare, author: alice.person)
|
||||
|
||||
reshare1.update_attributes(root_guid: nil)
|
||||
reshare1.update(root_guid: nil)
|
||||
|
||||
reshare2.root_guid = nil
|
||||
expect(reshare2).to be_valid
|
||||
|
|
|
|||
|
|
@ -302,8 +302,8 @@ describe User, :type => :model do
|
|||
end
|
||||
|
||||
it "resets a matching unconfirmed_email and confirm_email_token on save" do
|
||||
eve.update_attributes(unconfirmed_email: "new@example.com", confirm_email_token: SecureRandom.hex(15))
|
||||
alice.update_attribute(:email, "new@example.com")
|
||||
eve.update(unconfirmed_email: "new@example.com", confirm_email_token: SecureRandom.hex(15))
|
||||
alice.update(email: "new@example.com")
|
||||
eve.reload
|
||||
expect(eve.unconfirmed_email).to eql(nil)
|
||||
expect(eve.confirm_email_token).to eql(nil)
|
||||
|
|
|
|||
Loading…
Reference in a new issue