Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Fix some broken specs

Signed-off-by: Jorge Cuadrado <kuadrosxx@gmail.com>
  • Loading branch information...
commit caf30c91ff4a8276a9c9bcab297a9d7d7c81a4f0 1 parent d207012
@kuadrosx kuadrosx authored patcito committed
View
6 Gemfile.lock
@@ -1,6 +1,6 @@
GIT
remote: git://github.com/dcu/mongoid_ext.git
- revision: edcb64748380ddf6f6b7e621bec81ba7ddf7097c
+ revision: f5c5659260aef321befb19c94bb4b3ca21e97a3e
specs:
mongoid_ext (0.7.0)
differ (>= 0.1.2)
@@ -36,7 +36,7 @@ GIT
GIT
remote: git://github.com/mongoid/mongoid.git
- revision: 305a6af10bc594a10034c478497b50126627adc5
+ revision: a99f4aebbe1c3214d114809d45f46d887771bc04
branch: 2.4.0-stable
specs:
mongoid (2.4.5)
@@ -46,7 +46,7 @@ GIT
GIT
remote: git://github.com/ricodigo/bug_hunter.git
- revision: 103ec83b35100328b3fa91eb89d961fe5e62a85f
+ revision: b5bfc8420dc8c2a8ca3ea5a2874a9dec2e6fb624
specs:
bug_hunter (0.2.0)
haml
View
2  app/controllers/close_requests_controller.rb
@@ -37,7 +37,7 @@ def create
respond_to do |format|
if @close_request.valid?
- @question.save #FIXME: use modifiers
+ @question.save
@question.increment(:close_requests_count => 1)
if @question.closed
flash[:notice] = "question closed successfully"
View
2  app/helpers/votes_helper.rb
@@ -15,7 +15,7 @@ def vote_box(voteable, source, closed = false)
end
end
- render 'shared/vote_box.html.haml', :url => url, :voteable => voteable,
+ render 'shared/vote_box', :handlers => [:haml], :url => url, :voteable => voteable,
:class_name => class_name, :source => source,
:closed => closed
end
View
4 app/models/close_request.rb
@@ -41,6 +41,10 @@ def self.humanize_action(action)
end
end
+ def group
+ self._parent.group
+ end
+
protected
def should_be_unique
valid = true
View
2  app/views/shared/_posts.html.haml
@@ -29,6 +29,6 @@
-cache_for(:questions, current_order.to_s, params[:page].to_i, params[:per_page].to_i, @languages.sort, params[:unanswered] ? "unanswered" : "" ) do
/Questions
-@questions.each do |question|
- = render "questions/question", :question => question
+ = render "questions/question", :handers => [:haml], :question => question
= paginate @questions
View
4 spec/controllers/close_requests_controller_spec.rb
@@ -44,7 +44,7 @@ def valid_attributes
describe "PUT 'update'" do
before (:each) do
- @close_request = Fabricate(:close_request, :user_id => @user.id, :question_id => @question.id)
+ @close_request = Fabricate(:close_request, :user_id => @user.id, :closeable => @question)
@close_request_attrs = valid_attributes
stub_group(@question.group)
end
@@ -57,7 +57,7 @@ def valid_attributes
describe "DELETE 'destroy'" do
before (:each) do
- @close_request = Fabricate(:close_request, :user_id => @user.id, :question_id => @question.id)
+ @close_request = Fabricate(:close_request, :user_id => @user.id, :closeable => @question)
end
it "should be successful" do
View
6 spec/controllers/comments_controller_spec.rb
@@ -20,7 +20,7 @@
describe "GET 'edit'" do
before (:each) do
- @comment = Fabricate(:comment, :commentable => @question, :group_id => @group.id, :user_id => @user.id)
+ @comment = Fabricate(:comment, :commentable => @question, :user_id => @user.id)
stub_group(@question.group)
end
@@ -34,7 +34,6 @@
before (:each) do
@comment = Fabricate(:comment,
:commentable => @question,
- :group_id => @group.id,
:user_id => @user.id)
stub_group(@group)
end
@@ -49,7 +48,6 @@
before (:each) do
@comment = Fabricate(:comment,
:commentable => @question,
- :group_id => @group.id,
:user_id => @user.id)
@comment_attrs = Fabricate.attributes_for(:comment, :user => @user)
@@ -65,7 +63,7 @@
describe "DELETE 'destroy'" do
before (:each) do
- @comment = Fabricate(:comment, :commentable => @question, :group_id => @group.id, :user_id => @user.id)
+ @comment = Fabricate(:comment, :commentable => @question, :user_id => @user.id)
stub_group(@question.group)
end
View
4 spec/controllers/groups_controller_spec.rb
@@ -53,7 +53,7 @@
end
it "should be successful" do
- attributes = Fabricate.attributes_for(:group, :user => @user)
+ attributes = Fabricate.attributes_for(:group, :owner => @user)
attributes.delete('languages')
post 'create', :group => attributes
response.should redirect_to "http://#{assigns[:group].domain}/manage/properties"
@@ -62,7 +62,7 @@
describe "PUT 'update'" do
before (:each) do
- @group_attrs = Fabricate.attributes_for(:group, :user => @user)
+ @group_attrs = Fabricate.attributes_for(:group, :owner => @user)
end
it "should be successful" do
View
3  spec/spec_helper.rb
@@ -57,6 +57,7 @@ def create_group
theme = Theme.create_default
Jobs::Themes.generate_stylesheet(theme.id)
@group = Fabricate(:group, :domain => AppConfig.domain, :current_theme => theme)
+ Thread.current[:current_group] = @group
end
require 'database_cleaner'
@@ -71,12 +72,10 @@ def create_group
end
config.before(:each) do
-# Sham.reset(:before_all)
Capybara.default_driver = :selenium
Capybara.javascript_driver = :selenium
Capybara.default_host = AppConfig.domain
Xapit.reload
-# Sham.reset(:before_each)
DatabaseCleaner.clean
end
end
Please sign in to comment.
Something went wrong with that request. Please try again.