Conversation
Media RankerWhat We're Looking For
|
|
|
||
| root "welcome#index" | ||
|
|
||
| resources :users |
There was a problem hiding this comment.
Do you really need all routes for each of these controllers? Limit the routes to only the ones you're using.
Example:
resources :users, only: [:index, :show]| fields = [:movie, :book, :album ] | ||
|
|
||
| fields.each do |field| | ||
| expect(vote).must_respond_to field |
There was a problem hiding this comment.
This test is failing because votes don't have a separate field for the different categories, it should be:
fields = [:work, :user]| let(:vote) { Vote.new } | ||
|
|
||
| it "must be for a valid category" do | ||
| value(vote).must_be_kind_of :work |
There was a problem hiding this comment.
This doesn't make sense because votes aren't work.
| end | ||
|
|
||
| it 'user has the required fields' do | ||
| fields = [:user_name ] |
There was a problem hiding this comment.
You should also include the field :votes in this list.
| require "test_helper" | ||
|
|
||
| describe User do | ||
| let(:user) { users(:simple) } |
There was a problem hiding this comment.
You also need a validation test for user_name
| top_ten("movie") | ||
| end | ||
|
|
||
| def self.top_ten(category) |
There was a problem hiding this comment.
These are some great custom methods!
| <%= stylesheet_link_tag 'application', 'https://fonts.googleapis.com/css?family=Gudea:400,700|Hammersmith+One' %> | ||
| <%= stylesheet_link_tag 'application', media: 'all', 'data-turbolinks-track': 'reload' %> | ||
| <%= javascript_include_tag 'application', 'data-turbolinks-track': 'reload' %> | ||
| <%= favicon_link_tag 'favicon.ico' %> |
There was a problem hiding this comment.
I'm not seeing this favicon in your files, so it's not running for me.
|
|
||
| <tr> | ||
| <td>25</td> | ||
| <td><a href="/works/134">The Hipster and the Beast</a></td> |
There was a problem hiding this comment.
Why were you hardcoding this here rather than using model data?
| <h2>Add a new work</h2> | ||
| <section> | ||
| <label>Category</label> | ||
| <select class="form-control" name="work[category]"><option value="album">album</option> |
There was a problem hiding this comment.
You are not using form_with or other Rails form controls.
|
|
||
| get "/:page" => "welcome#index" | ||
|
|
||
| get '/login', to: 'sessions#new' |
There was a problem hiding this comment.
You don't have a new method in your sessions controller.
| # Read about fixtures at http://api.rubyonrails.org/classes/ActiveRecord/FixtureSet.html | ||
|
|
||
| one: | ||
| category: movie |
Media Ranker
Congratulations! You're submitting your assignment!
Comprehension Questions
sessionandflash? What is the difference between them?