Commit a980d848 by Arjun Singh

Comment out observer-related stuff.

parent f8e3aadb
require 'spec_helper' require 'spec_helper'
describe AtUserObserver do # Commenting out until notifications are used again.
before :each do #
@text = #describe AtUserObserver do
""" # before :each do
hi @tom, I have a question from @pi314 about the following code: # @text =
``` #"""
class A #hi @tom, I have a question from @pi314 about the following code:
def set_some_variable #```
@some_variable = 1 #class A
end # def set_some_variable
end # @some_variable = 1
``` # end
and also the following code #end
class A #```
def get_some_variable #and also the following code
@some_variable # class A
end # def get_some_variable
end # @some_variable
what is the 'at' symbol doing there? @dementrock # end
""" # end
User.delete_all #what is the 'at' symbol doing there? @dementrock
User.create!(external_id: "1", username: "tom", email: "tom@test.com") #"""
User.create!(external_id: "2", username: "pi314", email: "pi314@test.com") # User.delete_all
end # User.create!(external_id: "1", username: "tom", email: "tom@test.com")
# User.create!(external_id: "2", username: "pi314", email: "pi314@test.com")
describe "#get_marked_text(text)" do # end
it "returns marked at text" do #
converted = AtUserObserver.send :get_marked_text, @text # describe "#get_marked_text(text)" do
converted.should include "@tom_0" # it "returns marked at text" do
converted.should include "@pi314_1" # converted = AtUserObserver.send :get_marked_text, @text
converted.should include "@some_variable_2" # converted.should include "@tom_0"
converted.should include "@some_variable_3" # converted.should include "@pi314_1"
converted.should include "@dementrock_4" # converted.should include "@some_variable_2"
end # converted.should include "@some_variable_3"
end # converted.should include "@dementrock_4"
# end
describe "#get_valid_at_position_list(text)" do # end
it "returns the list of positions for the valid @ notifications, filtering out the ones in code blocks" do #
list = AtUserObserver.send :get_valid_at_position_list, @text # describe "#get_valid_at_position_list(text)" do
list.should include({ position: 0, username: "tom", user_id: "1" }) # it "returns the list of positions for the valid @ notifications, filtering out the ones in code blocks" do
list.should include({ position: 1, username: "pi314", user_id: "2" }) # list = AtUserObserver.send :get_valid_at_position_list, @text
list.length.should == 2 # list.should include({ position: 0, username: "tom", user_id: "1" })
end # list.should include({ position: 1, username: "pi314", user_id: "2" })
end # list.length.should == 2
end # end
# end
#end
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment