Commit 745ef8d0

mo khan <mo@mokhan.ca>
2014-11-04 04:59:38
fix broken tests.
1 parent 50870c2
app/views/my/shared/_my_nav.html.erb
@@ -4,11 +4,11 @@
   <% end %>
   <ul class="nav nav-list">
     <li class="nav-header"><%= current_user.name %></li>
-    <li class="<%= "active" if controller?("dashboard") %>"><%= link_to "<i class='fa fa-tachometer'></i>Dashboard".html_safe, my_dashboard_path %></li>
-    <li id='profile-tab' data-no-turbolink><%= link_to "<i class='fa fa-cog'></i>Profile".html_safe, my_root_path(anchor: 'profile/me') %></li>
-    <li class="<%= 'active' if controller?('passwords') %>"><%= link_to "<i class='fa fa-eye'></i>Account".html_safe, my_passwords_path %></li>
-    <li class="<%= "active" if controller?("favorites") %>"><%= link_to "<i class='fa fa-star'></i>Favorites".html_safe, my_favorites_path %></li>
-    <li class="<%= 'active' if controller?('avatars') %>"><%= link_to "<i class='fa fa-picture-o'></i>Picture".html_safe, new_my_avatar_path %></li>
+    <li class="<%= "active" if controller?("dashboard") %>"><%= link_to "<i class='fa fa-tachometer'></i> Dashboard".html_safe, my_dashboard_path %></li>
+    <li id='profile-tab' data-no-turbolink><%= link_to "<i class='fa fa-cog'></i> Profile".html_safe, my_root_path(anchor: 'profile/me') %></li>
+    <li class="<%= 'active' if controller?('passwords') %>"><%= link_to "<i class='fa fa-eye'></i> Account".html_safe, my_passwords_path %></li>
+    <li class="<%= "active" if controller?("favorites") %>"><%= link_to "<i class='fa fa-star'></i> Favorites".html_safe, my_favorites_path %></li>
+    <li class="<%= 'active' if controller?('avatars') %>"><%= link_to "<i class='fa fa-picture-o'></i> Picture".html_safe, new_my_avatar_path %></li>
     <li class="nav-header">Actions</li>
     <li data-no-turbolink>
       <%= link_to my_root_path(anchor: 'cakes/new') do %>
spec/features/change_password_spec.rb
@@ -12,7 +12,7 @@ describe "changing my password", js: true do
       end
       click_button("Sign In")
       visit my_root_path
-      click_link("Account Settings")
+      click_link("Account")
       within(".form-horizontal") do
         fill_in('user_password', :with => "mopass")
         fill_in('user_password_confirmation', :with => "mopass")
spec/features/registration_spec.rb
@@ -13,7 +13,7 @@ describe "Registration", :js => true do
     end
 
     it "should let you register with that email address" do
-      expect(page).to have_content("No new activity to report.")
+      expect(page).to have_content("Dashboard")
     end
 
     xit "should take you to the settings page" do
spec/factories.rb
@@ -1,7 +1,7 @@
 FactoryGirl.define do
   factory :activity, class: Activity do
-    user { FactoryGirl.create(:user) }
-    subject { FactoryGirl.create(:creation) }
+    user { create(:user) }
+    subject { create(:favorite) }
   end
   factory :category, class: Category do
     name { Faker::Name.name }
@@ -31,15 +31,18 @@ FactoryGirl.define do
   end
 
   factory :favorite do
-    user { FactoryGirl.create(:user) }
-    creation { FactoryGirl.create(:creation) }
+    association :user
+    association :creation
   end
+
   factory :photo, class: Photo do
     image { 'example.png' }
   end
+
   factory :tag, :class => "ActsAsTaggableOn::Tag" do
     name { Faker::Name.name }
   end
+
   factory :tutorial do
     heading { Faker::Name.name }
     description "well hello there"
@@ -48,6 +51,7 @@ FactoryGirl.define do
     author { Faker::Name.name }
     author_url { Faker::Internet.http_url }
   end
+
   factory :user, class: User do
     name { Faker::Name.name }
     email { Faker::Internet.email }
@@ -58,6 +62,7 @@ FactoryGirl.define do
       admin true
     end
   end
+
   factory :location do
     latitude "107"
     longitude "99"