Skip to content

Instantly share code, notes, and snippets.

View alanmaciel's full-sized avatar
Work and play, same thing, differing conditions. ~Mark Twain

Alan Maciel alanmaciel

Work and play, same thing, differing conditions. ~Mark Twain
View GitHub Profile
require 'spec_helper'
describe 'A review' do
it "belongs to a Movie" do
movie = Movie.create(movie_attributes)
review = movie.reviews.new(review_attributes)
expect(review.movie).to eq(movie)
// Place all the styles related to the Reviews controller here.
// They will automatically be included in application.css.
// You can use Sass (SCSS) here: http://sass-lang.com/
$primary-background-color: #F5F5F5;
$secondary-background-color: #237CBE;
$primary-text-color: #444;
$secondary-text-color: #777;
$primary-link-color: #2E6AA0;
$secondary-link-color: #FFF;
$errors-background-color: #FFC;
$errors-text-color: #DC3D3D;
$subdued-color: darken($primary-background-color, 20%);
$flash-notice-color: #DBFFDD;
@import "colors";
img {
border: 0;
border-width: 0;
}
ul,
ol {
margin: 1em 0;
<% flash.each do |key, value| %>
<%= content_tag(:p, value, :class => "flash #{key}") %>
<% end %>
<% flash.each do |key, value| %>
<%= content_tag(:p, value, :class => "flash #{key}") %>
<% end %>
<%= form_for(@movie) do |f| %>
<%= render "shared/errors", object: @movie %>
<fieldset>
<ol>
<li class="required">
<%= f.label :title %>
<%= f.text_field :title, autofocus: true %>
</li>
<li class="required">
<%= f.label :description %>
<li class="required stars">
<%= f.label :stars %>
<% Review::STARS.each do |star| %>
<span class="star">
<%= f.radio_button :stars, star %> <%= star %>
</span>
<% end %>
</li>