Skip to content

Commit

Permalink
Add a test for /admin/repos
Browse files Browse the repository at this point in the history
  • Loading branch information
philc committed Apr 16, 2012
1 parent 3623eed commit eedec92
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 3 deletions.
10 changes: 8 additions & 2 deletions test/unit/app_test.rb
Expand Up @@ -158,11 +158,17 @@ def setup_repo(name)
assert_status 200 assert_status 200
end end


should "show a list of repos" do
meta_repo = MetaRepo.new(FIXTURES_PATH)
stub(MetaRepo).instance { meta_repo }
get "/admin/repos"
assert_status 200
dom_response.css("repoList").text.include?(meta_repo.repos.first.name)
end

teardown do teardown do
any_instance_of(Barkeep, :current_user => @user) any_instance_of(Barkeep, :current_user => @user)
end end
end end
end end

def assert_status(status_code) assert_equal status_code, last_response.status end
end end
2 changes: 1 addition & 1 deletion views/admin/repos.erb
Expand Up @@ -46,7 +46,7 @@


<h2>Repos currently monitored</h2> <h2>Repos currently monitored</h2>


<table> <table id="repoList">
<th>Name</th> <th>Name</th>
<th>URL</th> <th>URL</th>
<th>Newest fetched commit</th> <th>Newest fetched commit</th>
Expand Down

0 comments on commit eedec92

Please sign in to comment.