Created
October 27, 2017 02:34
-
-
Save Awlter/4501421b9735994c246d4a553a260662 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ bin/rspec spec/models/user_spec.rb:11 | |
Running via Spring preloader in process 2346 | |
Run options: include {:locations=>{"./spec/models/user_spec.rb"=>[11]}} | |
User | |
From: /Users/wangxuefei/Documents/rails/yelp_clone/lib/sluggable.rb @ line 10 Sluggable#to_slug: | |
9: def to_slug | |
=> 10: binding.pry | |
11: slug = self.send(self.class.slug_column).gsub(/[^a-zA-Z0-9]/, '-').downcase | |
12: slug.gsub(/[-]+/, '-') | |
13: end | |
[1] pry(#<User>)> self | |
=> #<User:0x007ff9bd7a1890 | |
id: nil, | |
email: "an arbitrary value", | |
password_digest: "$2a$04$SLkzCQ3WcldhO9MxmzfD2uU8LfDgPP44RDWbFYPnoxwuqOFyXaqSm", | |
first_name: nil, | |
last_name: nil, | |
created_at: nil, | |
updated_at: nil, | |
slug: nil> | |
[2] pry(#<User>)> self.first_name = 'launch' | |
=> "launch" | |
[3] pry(#<User>)> self.last_name = 'school' | |
=> "school" | |
[4] pry(#<User>)> quit | |
From: /Users/wangxuefei/Documents/rails/yelp_clone/lib/sluggable.rb @ line 10 Sluggable#to_slug: | |
9: def to_slug | |
=> 10: binding.pry | |
11: slug = self.send(self.class.slug_column).gsub(/[^a-zA-Z0-9]/, '-').downcase | |
12: slug.gsub(/[-]+/, '-') | |
13: end | |
[1] pry(#<User>)> self | |
=> #<User:0x007ff9bd7a1890 | |
id: nil, | |
email: "AN ARBITRARY VALUE", | |
password_digest: "$2a$04$SLkzCQ3WcldhO9MxmzfD2uU8LfDgPP44RDWbFYPnoxwuqOFyXaqSm", | |
first_name: "launch", | |
last_name: "school", | |
created_at: nil, | |
updated_at: nil, | |
slug: "launch-school"> | |
[2] pry(#<User>)> quit | |
should validate that :email is case-sensitively unique | |
Finished in 5 minutes 1 second (files took 1.19 seconds to load) | |
1 example, 0 failures |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment