Permalink
Browse files

add specs for changesets#index

  • Loading branch information...
1 parent 5e55239 commit c216db424a78085125d88bbc093a4662dcf51e28 @jimmycuadra committed Feb 10, 2011
Showing with 18 additions and 0 deletions.
  1. +18 −0 spec/controllers/changesets_controller_spec.rb
View
18 spec/controllers/changesets_controller_spec.rb
@@ -0,0 +1,18 @@
+require 'spec_helper'
+
+describe ChangesetsController do
+ describe "#index" do
+ it "displays the last 10 unmerged changesets" do
+ changeset_ids = []
+ 1.upto(11) do |n|
+ changeset = Factory(:changeset, :revision => n)
+ changeset_ids.push changeset.id
+ end
+ changeset_ids.reverse!
+ changeset_ids.pop
+
+ get :index
+ assigns(:changesets).map(&:id).should == changeset_ids
+ end
+ end
+end

0 comments on commit c216db4

Please sign in to comment.