Commit 9d24b518 authored by Dennis Collinson's avatar Dennis Collinson

DC DG; correctly populate the stream jasmine fixture

parent 5e28c8f6
......@@ -129,6 +129,8 @@ group :test do
gem 'cucumber-api-steps', '0.6', :require => false
gem 'database_cleaner', '0.7.0'
gem 'diaspora-client', :git => 'git://github.com/diaspora/diaspora-client.git'
gem 'timecop'
#"0.1.0", #:path => '~/workspace/diaspora-client'
gem 'factory_girl_rails'
gem 'fixture_builder', '0.3.1'
......
......@@ -417,6 +417,7 @@ GEM
rack (>= 1.0.0)
thor (0.14.6)
tilt (1.3.3)
timecop (0.3.5)
treetop (1.4.10)
polyglot
polyglot (>= 0.3.1)
......@@ -530,6 +531,7 @@ DEPENDENCIES
sod!
sqlite3
thin (~> 1.3.1)
timecop
twitter (= 2.0.2)
typhoeus
vanna!
......
......@@ -13,22 +13,25 @@ describe MultisController do
it 'generates the multi_stream_json fixture', :fixture => true do
posts = []
10.times do
posts << alice.post(:status_message, :text => "hella infos yo!", :to => alice.aspects.first.id)
posts << alice.post(:reshare, :root_guid => Factory(:status_message, :public => true).guid, :to => 'all')
posts << alice.post(:status_message, :text => "you're gonna love this.'", :to => alice.aspects.first.id)
alice.like(1, :target => posts.last)
end
time = Time.now
posts.each do |p|
time += 1.day
p.stub(:created_at).and_return(time)
10.times do
Timecop.travel time += 1.day do
Timecop.travel time += 1.minute
posts << alice.post(:status_message, :text => "hella infos yo!", :to => alice.aspects.first.id)
Timecop.travel time += 1.minute
posts << alice.post(:reshare, :root_guid => Factory(:status_message, :public => true).guid, :to => 'all')
Timecop.travel time += 1.minute
posts << alice.post(:status_message, :text => "you're gonna love this.'", :to => alice.aspects.first.id)
Timecop.travel time += 1.minute
alice.like(1, :target => posts.last)
end
end
get :index, :format => :json
response.should be_success
save_fixture(response.body, "multi_stream_json")
Timecop.return
end
end
end
......@@ -4,7 +4,7 @@ describe("app.views.Feedback", function(){
var posts = $.parseJSON(spec.readFixture("multi_stream_json"))["posts"];
this.post = new app.models.Post(posts[2]);
this.post = new app.models.Post(posts[0]);
this.view = new app.views.Feedback({model: this.post});
});
......
......@@ -3,7 +3,7 @@ describe("app.views.LikesInfo", function(){
window.current_user = app.user({id : -1, name: "alice", avatar : {small : "http://avatar.com/photo.jpg"}});
var posts = $.parseJSON(spec.readFixture("multi_stream_json"))["posts"];
this.post = new app.models.Post(posts[2]); // post with a like
this.post = new app.models.Post(posts[0]); // post with a like
this.view = new app.views.LikesInfo({model: this.post});
});
......
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