Commit f6ace8f9
Changed files (15)
app
views
categories
creations
favorites
registrations
search
spec
controllers
models
app/views/categories/show.html.erb
@@ -1,6 +1,4 @@
-<% content_for :title do %>
- All Creations in <%= @category.name %>
-<% end %>
+<% provide(:title, "#{@category.name} Cakes") -%>
<div class="page-header">
<h1>Category <em><%= @category.name %></em></h1>
</div>
app/views/creations/edit.html.erb
@@ -1,6 +1,4 @@
-<% content_for :title do %>
- Editing creation <%= @creation.name %>
-<% end %>
+<% provide(:title, "Editing creation #{@creation.name}") %>
<div class="page-header">
<h1><small>Edit</small> <%= @creation.name %></h1>
</div>
app/views/creations/index.html.erb
@@ -26,7 +26,7 @@
<h2>Inspire a community</h2>
<p>Upload creations, teach with tutorials, and create a vibrant community for everything cake.</p>
</div>
- </div><!--/row-->
+ </div>
<div class="row">
<p style="text-align: center;">
Still interested...? <a href="<%= url_for new_user_session_path %>">sign up now</a>
app/views/creations/new.html.erb
@@ -1,6 +1,4 @@
-<% content_for :title do %>
- Share my creation
-<% end %>
+<% provide(:title, "Share my creation") -%>
<div class="page-header">
<h1>Share a new creation</h1>
</div>
app/views/favorites/index.html.erb
@@ -1,4 +1,4 @@
-<% content_for :title do %> <%= @creation.name %> by <%= @creation.user.name %> - fanclub <% end %>
+<% provide(:title, "#{@creation.name} by #{@creation.user.name} - fanclub") -%>
<div class="page-header">
<h1> fans of <%= link_to @creation.name, creation_path(@creation) %> <small> submitted by <%= link_to @creation.user.name, profile_path(@creation.user) %> </small> </h1>
</div>
app/views/home/about_us.html.erb
@@ -1,6 +1,4 @@
-<% content_for :title do %>
- About Us
-<% end %>
+<% provide(:title, "About Us") -%>
<h2>About us</h2>
<p>CakeSide is a community dedicated to giving cake artists, bakers, creators, hobbyists, and of course cake lovers a place to share ideas and creations. Explore your creativity and find your inspiration. Resources shared here are all user driven.</p>
app/views/home/why_cakeside.html.erb
@@ -1,6 +1,4 @@
-<% content_for :title do %>
- About Us
-<% end %>
+<% provide(:title, "About Us") -%>
<h2>Why Cakeside</h2>
<p>We are a passionate team dedicated to improving the cake sharing experience. Frustrated with the lack of community that provides more than just photo sharing, CakeSide was born. All features of this site will be user inspired. We love to listen so feel free to give us <a target="_blank" href="http://cakeside.uservoice.com/">feedback</a>. Check back often to see what's new in the CakeSide community!</p>
app/views/profiles/favorites.html.erb
@@ -1,4 +1,4 @@
-<% content_for :title do %>My Favorites<% end %>
+<% provide(:title, "My Favorites") -%>
<div class="row">
<div class="span3">
<div class="thumbnail">
app/views/profiles/index.html.erb
@@ -1,6 +1,4 @@
-<% content_for :title do %>
- <%= pluralize @profiles.length, "artist" %>
-<% end %>
+<% provide(:title, pluralize(@profiles.length, "artist")) -%>
<div class="page-header">
<h1><%= pluralize @profiles.length, "artist" %></h1>
</div>
app/views/profiles/mine.html.erb
@@ -1,6 +1,4 @@
-<% content_for :title do %>
- My profile
-<% end %>
+<% provide(:title, "My profile") -%>
<div class="row">
<div class="span3">
<div class="thumbnail">
app/views/profiles/show.html.erb
@@ -1,6 +1,4 @@
-<% content_for :title do %>
- <%= @profile.name %>
-<% end %>
+<% provide(:title, "#{profile.name}") -%>
<div class="row">
<div class="span12">
<h1>
app/views/registrations/edit.html.erb
@@ -1,4 +1,4 @@
-<% content_for :title do %>Update My Account<% end %>
+<% provide(:title, "Update My Account") -%>
<% content_for :head do %>
<script type="text/javascript" charset="utf-8">
$(function(){ DeviseUsers.Edit.initialize(jQuery); });
app/views/search/index.html.erb
@@ -1,4 +1,4 @@
-<% content_for :title do %>Search Results for <%= @search %><% end %>
+<% provide(:title, "#{@search}") -%>
<div class="row">
<div class="span12">
<h1>Search Results for <em><%= @search %></em></h1>
spec/controllers/registrations_controller_spec.rb
@@ -1,21 +1,12 @@
require 'spec_helper'
-#module Devise
-#class RegistrationsController
-
-#end
-#end
describe RegistrationsController do
- before (:each) do
- #request.env['warden'] = mock(Warden, :authenticate => user, :authenticate! => user)
- end
- #let(:user){ FactoryGirl.build(:user) }
- let(:user){ User.new( :id => 2) }
+ let(:sut) { RegistrationsController.new }
+ let(:user){ fake }
context "when updating a users profile settings not including their password" do
it "should update their website" do
- controller = RegistrationsController.new
- controller.stub(:current_user).and_return(user)
+ sut.stub(:current_user).and_return(user)
payload = {
:current_password => '',
@@ -28,9 +19,9 @@ describe RegistrationsController do
:website => 'http://mokhan.ca/',
}
- #user.should_receive[:update_without_password].with(payload)
- #put :update, :id => user.id, :user => payload
+ user.should have_received(:update_without_password,payload)
end
+
it "should not change their password" do
end
spec/models/user_spec.rb
@@ -2,13 +2,13 @@
describe User do
#describe "when a user already likes a creation" do
- #it "should not let the user like it again" do
- #creation = FactoryGirl.create(:creation)
- #user = FactoryGirl.create(:user)
- #user.add_favorite(creation)
- #user.add_favorite(creation)
- #creation.favorites.length.should eq(1)
- #end
+ #it "should not let the user like it again" do
+ #creation = FactoryGirl.create(:creation)
+ #user = FactoryGirl.create(:user)
+ #user.add_favorite(creation)
+ #user.add_favorite(creation)
+ #creation.favorites.length.should eq(1)
+ #end
#end
describe "when a website url is supplied" do
describe "when the url is valid" do