Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

specs are running. not passing

  • Loading branch information...
commit 003db55284b1c374750a67b04c8783e18adf46d5 1 parent ac7b548
Derick Hitchcock authored
View
164 spec/controllers/events_controller_spec.rb
@@ -1,164 +0,0 @@
-require 'spec_helper'
-
-# This spec was generated by rspec-rails when you ran the scaffold generator.
-# It demonstrates how one might use RSpec to specify the controller code that
-# was generated by Rails when you ran the scaffold generator.
-#
-# It assumes that the implementation code is generated by the rails scaffold
-# generator. If you are using any extension libraries to generate different
-# controller code, this generated spec may or may not pass.
-#
-# It only uses APIs available in rails and/or rspec-rails. There are a number
-# of tools you can use to make these specs even more expressive, but we're
-# sticking to rails and rspec-rails APIs to keep things simple and stable.
-#
-# Compared to earlier versions of this generator, there is very limited use of
-# stubs and message expectations in this spec. Stubs are only used when there
-# is no simpler way to get a handle on the object needed for the example.
-# Message expectations are only used when there is no simpler way to specify
-# that an instance is receiving a specific message.
-
-describe EventsController do
-
- # This should return the minimal set of attributes required to create a valid
- # Event. As you add validations to Event, be sure to
- # update the return value of this method accordingly.
- def valid_attributes
- {}
- end
-
- # This should return the minimal set of values that should be in the session
- # in order to pass any filters (e.g. authentication) defined in
- # EventsController. Be sure to keep this updated too.
- def valid_session
- {}
- end
-
- describe "GET index" do
- it "assigns all events as @events" do
- event = Event.create! valid_attributes
- get :index, {}, valid_session
- assigns(:events).should eq([event])
- end
- end
-
- describe "GET show" do
- it "assigns the requested event as @event" do
- event = Event.create! valid_attributes
- get :show, {:id => event.to_param}, valid_session
- assigns(:event).should eq(event)
- end
- end
-
- describe "GET new" do
- it "assigns a new event as @event" do
- get :new, {}, valid_session
- assigns(:event).should be_a_new(Event)
- end
- end
-
- describe "GET edit" do
- it "assigns the requested event as @event" do
- event = Event.create! valid_attributes
- get :edit, {:id => event.to_param}, valid_session
- assigns(:event).should eq(event)
- end
- end
-
- describe "POST create" do
- describe "with valid params" do
- it "creates a new Event" do
- expect {
- post :create, {:event => valid_attributes}, valid_session
- }.to change(Event, :count).by(1)
- end
-
- it "assigns a newly created event as @event" do
- post :create, {:event => valid_attributes}, valid_session
- assigns(:event).should be_a(Event)
- assigns(:event).should be_persisted
- end
-
- it "redirects to the created event" do
- post :create, {:event => valid_attributes}, valid_session
- response.should redirect_to(Event.last)
- end
- end
-
- describe "with invalid params" do
- it "assigns a newly created but unsaved event as @event" do
- # Trigger the behavior that occurs when invalid params are submitted
- Event.any_instance.stub(:save).and_return(false)
- post :create, {:event => {}}, valid_session
- assigns(:event).should be_a_new(Event)
- end
-
- it "re-renders the 'new' template" do
- # Trigger the behavior that occurs when invalid params are submitted
- Event.any_instance.stub(:save).and_return(false)
- post :create, {:event => {}}, valid_session
- response.should render_template("new")
- end
- end
- end
-
- describe "PUT update" do
- describe "with valid params" do
- it "updates the requested event" do
- event = Event.create! valid_attributes
- # Assuming there are no other events in the database, this
- # specifies that the Event created on the previous line
- # receives the :update_attributes message with whatever params are
- # submitted in the request.
- Event.any_instance.should_receive(:update_attributes).with({'these' => 'params'})
- put :update, {:id => event.to_param, :event => {'these' => 'params'}}, valid_session
- end
-
- it "assigns the requested event as @event" do
- event = Event.create! valid_attributes
- put :update, {:id => event.to_param, :event => valid_attributes}, valid_session
- assigns(:event).should eq(event)
- end
-
- it "redirects to the event" do
- event = Event.create! valid_attributes
- put :update, {:id => event.to_param, :event => valid_attributes}, valid_session
- response.should redirect_to(event)
- end
- end
-
- describe "with invalid params" do
- it "assigns the event as @event" do
- event = Event.create! valid_attributes
- # Trigger the behavior that occurs when invalid params are submitted
- Event.any_instance.stub(:save).and_return(false)
- put :update, {:id => event.to_param, :event => {}}, valid_session
- assigns(:event).should eq(event)
- end
-
- it "re-renders the 'edit' template" do
- event = Event.create! valid_attributes
- # Trigger the behavior that occurs when invalid params are submitted
- Event.any_instance.stub(:save).and_return(false)
- put :update, {:id => event.to_param, :event => {}}, valid_session
- response.should render_template("edit")
- end
- end
- end
-
- describe "DELETE destroy" do
- it "destroys the requested event" do
- event = Event.create! valid_attributes
- expect {
- delete :destroy, {:id => event.to_param}, valid_session
- }.to change(Event, :count).by(-1)
- end
-
- it "redirects to the events list" do
- event = Event.create! valid_attributes
- delete :destroy, {:id => event.to_param}, valid_session
- response.should redirect_to(events_url)
- end
- end
-
-end
View
164 spec/controllers/votes_controller_spec.rb
@@ -1,164 +0,0 @@
-require 'spec_helper'
-
-# This spec was generated by rspec-rails when you ran the scaffold generator.
-# It demonstrates how one might use RSpec to specify the controller code that
-# was generated by Rails when you ran the scaffold generator.
-#
-# It assumes that the implementation code is generated by the rails scaffold
-# generator. If you are using any extension libraries to generate different
-# controller code, this generated spec may or may not pass.
-#
-# It only uses APIs available in rails and/or rspec-rails. There are a number
-# of tools you can use to make these specs even more expressive, but we're
-# sticking to rails and rspec-rails APIs to keep things simple and stable.
-#
-# Compared to earlier versions of this generator, there is very limited use of
-# stubs and message expectations in this spec. Stubs are only used when there
-# is no simpler way to get a handle on the object needed for the example.
-# Message expectations are only used when there is no simpler way to specify
-# that an instance is receiving a specific message.
-
-describe VotesController do
-
- # This should return the minimal set of attributes required to create a valid
- # Vote. As you add validations to Vote, be sure to
- # update the return value of this method accordingly.
- def valid_attributes
- {}
- end
-
- # This should return the minimal set of values that should be in the session
- # in order to pass any filters (e.g. authentication) defined in
- # VotesController. Be sure to keep this updated too.
- def valid_session
- {}
- end
-
- describe "GET index" do
- it "assigns all votes as @votes" do
- vote = Vote.create! valid_attributes
- get :index, {}, valid_session
- assigns(:votes).should eq([vote])
- end
- end
-
- describe "GET show" do
- it "assigns the requested vote as @vote" do
- vote = Vote.create! valid_attributes
- get :show, {:id => vote.to_param}, valid_session
- assigns(:vote).should eq(vote)
- end
- end
-
- describe "GET new" do
- it "assigns a new vote as @vote" do
- get :new, {}, valid_session
- assigns(:vote).should be_a_new(Vote)
- end
- end
-
- describe "GET edit" do
- it "assigns the requested vote as @vote" do
- vote = Vote.create! valid_attributes
- get :edit, {:id => vote.to_param}, valid_session
- assigns(:vote).should eq(vote)
- end
- end
-
- describe "POST create" do
- describe "with valid params" do
- it "creates a new Vote" do
- expect {
- post :create, {:vote => valid_attributes}, valid_session
- }.to change(Vote, :count).by(1)
- end
-
- it "assigns a newly created vote as @vote" do
- post :create, {:vote => valid_attributes}, valid_session
- assigns(:vote).should be_a(Vote)
- assigns(:vote).should be_persisted
- end
-
- it "redirects to the created vote" do
- post :create, {:vote => valid_attributes}, valid_session
- response.should redirect_to(Vote.last)
- end
- end
-
- describe "with invalid params" do
- it "assigns a newly created but unsaved vote as @vote" do
- # Trigger the behavior that occurs when invalid params are submitted
- Vote.any_instance.stub(:save).and_return(false)
- post :create, {:vote => {}}, valid_session
- assigns(:vote).should be_a_new(Vote)
- end
-
- it "re-renders the 'new' template" do
- # Trigger the behavior that occurs when invalid params are submitted
- Vote.any_instance.stub(:save).and_return(false)
- post :create, {:vote => {}}, valid_session
- response.should render_template("new")
- end
- end
- end
-
- describe "PUT update" do
- describe "with valid params" do
- it "updates the requested vote" do
- vote = Vote.create! valid_attributes
- # Assuming there are no other votes in the database, this
- # specifies that the Vote created on the previous line
- # receives the :update_attributes message with whatever params are
- # submitted in the request.
- Vote.any_instance.should_receive(:update_attributes).with({'these' => 'params'})
- put :update, {:id => vote.to_param, :vote => {'these' => 'params'}}, valid_session
- end
-
- it "assigns the requested vote as @vote" do
- vote = Vote.create! valid_attributes
- put :update, {:id => vote.to_param, :vote => valid_attributes}, valid_session
- assigns(:vote).should eq(vote)
- end
-
- it "redirects to the vote" do
- vote = Vote.create! valid_attributes
- put :update, {:id => vote.to_param, :vote => valid_attributes}, valid_session
- response.should redirect_to(vote)
- end
- end
-
- describe "with invalid params" do
- it "assigns the vote as @vote" do
- vote = Vote.create! valid_attributes
- # Trigger the behavior that occurs when invalid params are submitted
- Vote.any_instance.stub(:save).and_return(false)
- put :update, {:id => vote.to_param, :vote => {}}, valid_session
- assigns(:vote).should eq(vote)
- end
-
- it "re-renders the 'edit' template" do
- vote = Vote.create! valid_attributes
- # Trigger the behavior that occurs when invalid params are submitted
- Vote.any_instance.stub(:save).and_return(false)
- put :update, {:id => vote.to_param, :vote => {}}, valid_session
- response.should render_template("edit")
- end
- end
- end
-
- describe "DELETE destroy" do
- it "destroys the requested vote" do
- vote = Vote.create! valid_attributes
- expect {
- delete :destroy, {:id => vote.to_param}, valid_session
- }.to change(Vote, :count).by(-1)
- end
-
- it "redirects to the votes list" do
- vote = Vote.create! valid_attributes
- delete :destroy, {:id => vote.to_param}, valid_session
- response.should redirect_to(votes_url)
- end
- end
-
-end
View
1  spec/helpers/events_helper_spec.rb
@@ -11,5 +11,4 @@
# end
# end
describe EventsHelper do
- pending "add some examples to (or delete) #{__FILE__}"
end
View
1  spec/helpers/votes_helper_spec.rb
@@ -11,5 +11,4 @@
# end
# end
describe VotesHelper do
- pending "add some examples to (or delete) #{__FILE__}"
end
View
1  spec/models/event_preferences_spec.rb
@@ -1,5 +1,4 @@
require 'spec_helper'
describe EventPreference do
- pending "add some examples to (or delete) #{__FILE__}"
end
View
21 spec/models/event_spec.rb
@@ -1,15 +1,16 @@
require 'spec_helper'
-before :all do
-
- vote1 = Vote.new
- vote2 = Vote.new
- vote3 = Vote.new
- timeslot1 = Timeslot.new
- timeslot2 = Timeslot.new
- event = Event.new(timeslots: [timeslot1, timeslot2])
-end
describe Event do
+ before :all do
+
+ vote1 = Vote.new
+ vote2 = Vote.new
+ vote3 = Vote.new
+ timeslot1 = Timeslot.new
+ timeslot2 = Timeslot.new
+ event = Event.new(timeslots: [timeslot1, timeslot2])
+ end
+
it "calculates the most popular time" do
timeslot1.votes = [vote1, vote2]
timeslot2.vote = vote3
@@ -17,7 +18,7 @@
end
-end
+
it "should calculate_event_time" do
end
View
1  spec/models/event_type_spec.rb
@@ -1,5 +1,4 @@
require 'spec_helper'
describe EventType do
- pending "add some examples to (or delete) #{__FILE__}"
end
View
1  spec/models/timeslot_spec.rb
@@ -1,5 +1,4 @@
require 'spec_helper'
describe Timeslot do
- pending "add some examples to (or delete) #{__FILE__}"
end
View
1  spec/models/user_event_preferences_spec.rb
@@ -1,5 +1,4 @@
require 'spec_helper'
describe UserEventPreference do
- pending "add some examples to (or delete) #{__FILE__}"
end
View
1  spec/models/user_spec.rb
@@ -1,5 +1,4 @@
require 'spec_helper'
describe User do
- pending "add some examples to (or delete) #{__FILE__}"
end
View
1  spec/models/vote_spec.rb
@@ -1,5 +1,4 @@
require 'spec_helper'
describe Vote do
- pending "add some examples to (or delete) #{__FILE__}"
end
View
31 spec/routing/events_routing_spec.rb
@@ -1,35 +1,4 @@
require "spec_helper"
describe EventsController do
- describe "routing" do
-
- it "routes to #index" do
- get("/events").should route_to("events#index")
- end
-
- it "routes to #new" do
- get("/events/new").should route_to("events#new")
- end
-
- it "routes to #show" do
- get("/events/1").should route_to("events#show", :id => "1")
- end
-
- it "routes to #edit" do
- get("/events/1/edit").should route_to("events#edit", :id => "1")
- end
-
- it "routes to #create" do
- post("/events").should route_to("events#create")
- end
-
- it "routes to #update" do
- put("/events/1").should route_to("events#update", :id => "1")
- end
-
- it "routes to #destroy" do
- delete("/events/1").should route_to("events#destroy", :id => "1")
- end
-
- end
end
View
31 spec/routing/votes_routing_spec.rb
@@ -1,35 +1,4 @@
require "spec_helper"
describe VotesController do
- describe "routing" do
-
- it "routes to #index" do
- get("/votes").should route_to("votes#index")
- end
-
- it "routes to #new" do
- get("/votes/new").should route_to("votes#new")
- end
-
- it "routes to #show" do
- get("/votes/1").should route_to("votes#show", :id => "1")
- end
-
- it "routes to #edit" do
- get("/votes/1/edit").should route_to("votes#edit", :id => "1")
- end
-
- it "routes to #create" do
- post("/votes").should route_to("votes#create")
- end
-
- it "routes to #update" do
- put("/votes/1").should route_to("votes#update", :id => "1")
- end
-
- it "routes to #destroy" do
- delete("/votes/1").should route_to("votes#destroy", :id => "1")
- end
-
- end
end
Please sign in to comment.
Something went wrong with that request. Please try again.