Skip to content

Commit

Permalink
updated Rspec test coverage
Browse files Browse the repository at this point in the history
  • Loading branch information
KelseyDH committed Apr 23, 2014
1 parent 4ef81f5 commit 23c0eb8
Show file tree
Hide file tree
Showing 14 changed files with 513 additions and 158 deletions.
2 changes: 1 addition & 1 deletion .rspec
Original file line number Diff line number Diff line change
@@ -1 +1 @@
--color
--color
3 changes: 3 additions & 0 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,9 @@ group :development, :test do
gem 'faker'
gem "factory_girl_rails"
gem "capybara"
# gem "capybara-webkit"
gem 'selenium-webdriver', '~> 2.41.0'
gem "database_cleaner"
end
# # DEPRECRATED Use sqlite3 as the database for Active Record
# gem 'sqlite3'
Expand Down
14 changes: 14 additions & 0 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,8 @@ GEM
rack (>= 1.0.0)
rack-test (>= 0.5.4)
xpath (~> 2.0)
childprocess (0.5.3)
ffi (~> 1.0, >= 1.0.11)
coderay (1.1.0)
coffee-rails (4.0.1)
coffee-script (>= 2.2.0)
Expand All @@ -53,6 +55,7 @@ GEM
execjs
coffee-script-source (1.7.0)
daemons (1.1.9)
database_cleaner (1.2.0)
debug_inspector (0.0.2)
delayed_job (4.0.1)
activesupport (>= 3.0, < 4.2)
Expand Down Expand Up @@ -116,6 +119,8 @@ GEM
mini_portile (0.5.3)
minitest (4.7.5)
multi_json (1.9.2)
nokogiri (1.6.1)
mini_portile (~> 0.5.0)
nokogiri (1.6.1-x86-mingw32)
mini_portile (~> 0.5.0)
orm_adapter (0.5.0)
Expand Down Expand Up @@ -158,6 +163,7 @@ GEM
rspec-mocks (~> 2.14.0)
ruby_parser (3.1.3)
sexp_processor (~> 4.1)
rubyzip (1.1.3)
sass (3.2.18)
sass-rails (4.0.2)
railties (>= 4.0.0, < 5.0)
Expand All @@ -167,6 +173,11 @@ GEM
sdoc (0.4.0)
json (~> 1.8)
rdoc (~> 4.0, < 5.0)
selenium-webdriver (2.41.0)
childprocess (>= 0.5.0)
multi_json (~> 1.0)
rubyzip (~> 1.0)
websocket (~> 1.0.4)
sexp_processor (4.4.3)
simplecov (0.8.2)
docile (~> 1.1.0)
Expand Down Expand Up @@ -207,6 +218,7 @@ GEM
json (>= 1.8.0)
warden (1.2.3)
rack (>= 1.0)
websocket (1.0.7)
xpath (2.0.0)
nokogiri (~> 1.3)

Expand All @@ -219,6 +231,7 @@ DEPENDENCIES
binding_of_caller
bootstrap-sass (~> 3.1.1)
capybara
database_cleaner
delayed_job_active_record
delayed_job_web
devise
Expand All @@ -238,6 +251,7 @@ DEPENDENCIES
rspec-rails
sass-rails (~> 4.0.0)
sdoc
selenium-webdriver (~> 2.41.0)
simplecov
thin
turbolinks
Expand Down
2 changes: 1 addition & 1 deletion app/views/answers/_answer.html.haml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,6 @@
%p= answer.body
%p Created on #{formatted_date(answer.created_at)}
.col-sm-8.col-md.8.col-xs-8
.pull-right= button_to "Delete", question_answer_path(@question, answer), method: :delete, class: "btn btn-danger", data: {confirm: "Are you sure you want to delete this answer?"}, remote: true, class: "btn btn-danger"
.pull-right= button_to "Delete", question_answer_path(@question, answer), method: :delete, class: "btn btn-danger", remote: true, class: "btn btn-danger"
// remote:true needed for AJAX
/ = link_to "Test Me" Javascript
10 changes: 5 additions & 5 deletions app/views/answers/create.js.haml
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
$("#answer_body").html("#{j rendewr 'form'}");
$("#answer_body").val("");
/ $("#answer_body").html("#{j rendewr 'form'}");
/ $("#answer_body").val("");
//Appends typed in answers to the top of @answer
//$(".answers").prepend("#{@answer.body}")
//Renders the _answer partial
//Renders the _answer partial via AJax
$(".answers").prepend("#{j render 'answer', answer: @answer}")

#("##{dom_id(@answer)}").hide().fadeIn(1000)");
/ #("##{dom_id(@answer)}").hide().fadeIn(1000)");
//Makes AJAX add of answer fade in
$("##{dom_id(@answer)}").hide().fadeIn(500)
/ $("##{dom_id(@answer)}").hide().fadeIn(500)
//Error message
$(".answeradd").prepend("#{@answer.body}")
2 changes: 1 addition & 1 deletion coverage/.last_run.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"result": {
"covered_percent": 96.53
"covered_percent": 97.23
}
}
112 changes: 75 additions & 37 deletions coverage/.resultset.json
Original file line number Diff line number Diff line change
Expand Up @@ -464,7 +464,7 @@
1,
1,
1,
55,
56,
null,
null,
1,
Expand All @@ -479,7 +479,7 @@
1,
1,
null,
91,
94,
null,
null,
null,
Expand Down Expand Up @@ -630,11 +630,11 @@
1,
null,
1,
0,
2,
null,
null,
1,
0,
2,
null,
null,
null,
Expand Down Expand Up @@ -662,7 +662,7 @@
null,
null,
1,
1,
5,
null,
null,
null
Expand Down Expand Up @@ -708,20 +708,20 @@
null,
1,
null,
2,
2,
3,
3,
null,
null,
null,
null,
null,
2,
2,
3,
3,
null,
2,
3,
null,
4,
2,
6,
3,
null,
null,
0,
Expand Down Expand Up @@ -754,13 +754,13 @@
null,
null,
1,
2,
3,
null,
null,
null,
null,
1,
2,
3,
null,
null,
null
Expand Down Expand Up @@ -1245,33 +1245,33 @@
null,
null,
1,
7,
8,
null,
null,
1,
3,
4,
null,
null,
1,
5,
7,
null,
null,
null,
7,
7,
5,
5,
4,
null,
1,
2,
null,
null,
null,
1,
4,
4,
4,
4,
2,
2,
2,
2,
0,
0,
null,
null,
null,
Expand Down Expand Up @@ -1306,7 +1306,7 @@
null,
null,
1,
9,
11,
null,
null,
null,
Expand Down Expand Up @@ -1438,21 +1438,59 @@
null,
1,
null,
3,
null,
1,
2,
null,
null,
null,
1,
1,
1,
1,
1,
1,
1,
null,
null,
1,
1,
null,
null,
1,
1,
1,
1,
1,
null,
0,
null,
null,
null,
null
],
"C:/Users/owner/Rails/Code/Ruby/weblog/spec/features/creating_an_answer_spec.rb": [
1,
null,
1,
null,
2,
2,
null,
1,
1,
null,
null,
1,
1,
1,
1,
1,
null,
null,
null
],
"C:/Users/owner/Rails/Code/Ruby/weblog/spec/features/home_page_spec.rb": [
1,
null,
Expand Down Expand Up @@ -1588,14 +1626,14 @@
null,
1,
null,
3,
5,
null,
null,
null,
1,
null,
1,
18,
19,
null,
null,
null
Expand Down Expand Up @@ -1761,7 +1799,7 @@
1,
null,
null,
108,
116,
null,
null,
1,
Expand Down Expand Up @@ -1825,21 +1863,14 @@
null,
null,
1,
61,
63,
null,
null,
1,
null,
null,
null
],
"C:/Users/owner/Rails/Code/Ruby/weblog/app/models/category.rb": [
1,
null,
1,
1,
null
],
"C:/Users/owner/Rails/Code/Ruby/weblog/app/models/vote.rb": [
1,
null,
Expand All @@ -1865,8 +1896,15 @@
1,
null,
null
],
"C:/Users/owner/Rails/Code/Ruby/weblog/app/models/category.rb": [
1,
null,
1,
1,
null
]
},
"timestamp": 1398192126
"timestamp": 1398219374
}
}
Loading

0 comments on commit 23c0eb8

Please sign in to comment.