Upgraded rspec 2.14.2 to 2.99.0

This commit is contained in:
Al Snow
2016-03-19 18:33:01 -04:00
parent 91edc5f283
commit fb923baee4
13 changed files with 80 additions and 43 deletions
+1 -1
View File
@@ -13,4 +13,4 @@
describe Api::V1::UsersHelper do
pending "add some examples to (or delete) #{__FILE__}"
end
=end
=end
+1 -1
View File
@@ -13,4 +13,4 @@
describe PasswordResetsHelper do
pending "add some examples to (or delete) #{__FILE__}"
end
=end
=end
+1 -1
View File
@@ -13,4 +13,4 @@
describe PayHelper do
pending "add some examples to (or delete) #{__FILE__}"
end
=end
=end
+2 -2
View File
@@ -11,7 +11,7 @@ describe User do
end
it "can be instantiated" do
Benefits.new.should be_an_instance_of(Benefits)
expect(Benefits.new).to be_an_instance_of(Benefits)
end
it "name can be updated" do
@@ -19,6 +19,6 @@ describe User do
user = User.all.first
user.first_name = new_name
user.save!
User.all.first.first_name.should == new_name
expect(User.all.first.first_name).to eq(new_name)
end
end
+1 -1
View File
@@ -3,4 +3,4 @@
describe Pay do
pending "add some examples to (or delete) #{__FILE__}"
end
=end
=end
+5 -5
View File
@@ -11,20 +11,20 @@ describe User do
end
it "can be instantiated" do
User.new.should be_an_instance_of(User)
expect(User.new).to be_an_instance_of(User)
end
it "should require a email" do
User.new(:email => "").should_not be_valid
expect(User.new(:email => "")).not_to be_valid
end
it "should require valid email" do
User.new(:email => "@gmail.com").should_not be_valid
expect(User.new(:email => "@gmail.com")).not_to be_valid
end
it "should require unique email" do
user = User.all.first
User.new(:email => user.email).should_not be_valid
expect(User.new(:email => user.email)).not_to be_valid
end
it "name can be updated" do
@@ -32,6 +32,6 @@ describe User do
user = User.all.first
user.first_name = new_name
user.save!
User.all.first.first_name.should == new_name
expect(User.all.first.first_name).to eq(new_name)
end
end
+11
View File
@@ -51,6 +51,17 @@ RSpec.configure do |config|
config.after(:each) do
DatabaseCleaner.clean
end
# rspec-rails 3 will no longer automatically infer an example group's spec type
# from the file location. You can explicitly opt-in to the feature using this
# config option.
# To explicitly tag specs without using automatic inference, set the `:type`
# metadata manually:
#
# describe ThingsController, :type => :controller do
# # Equivalent to being in spec/controllers
# end
config.infer_spec_type_from_file_location!
end
Capybara.javascript_driver = :poltergeist
@@ -3,4 +3,4 @@
describe "password_resets/new.html.erb" do
pending "add some examples to (or delete) #{__FILE__}"
end
=end
=end
@@ -23,6 +23,6 @@ feature 'command injection' do
end
click_on 'Start Upload'
end
pending(:if => verifying_fixed?) { File.exists?(legit_file).should be_false }
pending(:if => verifying_fixed?) { File.exists?(legit_file).should be_falsey }
end
end
end
+3 -3
View File
@@ -7,7 +7,7 @@ feature 'mass assignment' do
end
scenario 'attack one' do
@normal_user.admin.should be_false
@normal_user.admin.should be_falsey
login(@normal_user)
@@ -17,7 +17,7 @@ feature 'mass assignment' do
:password_confirmation => @normal_user.clear_password}}
page.driver.put "/users/#{@normal_user.user_id}.json", params
pending(:if => verifying_fixed?) { @normal_user.reload.admin.should be_true }
pending(:if => verifying_fixed?) { @normal_user.reload.admin.should be_truthy }
end
scenario 'attack two' do
@@ -31,7 +31,7 @@ feature 'mass assignment' do
pending(:if => verifying_fixed?) {
User.last.email.should == 'hackety@h4x0rs.c0m'
User.last.admin.should be_true
User.last.admin.should be_truthy
}
end
end
+2 -2
View File
@@ -8,7 +8,7 @@ feature 'sql injection' do
end
scenario 'attack' do
@admin_user.admin.should be_true
@admin_user.admin.should be_truthy
login(@normal_user)
@@ -29,4 +29,4 @@ feature 'sql injection' do
@admin_user.admin.should == true
}
end
end
end