Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

add specs for changesets#index

  • Loading branch information...
commit c216db424a78085125d88bbc093a4662dcf51e28 1 parent 5e55239
@jimmycuadra authored
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
Please sign in to comment.
Something went wrong with that request. Please try again.