MS DC fix tests
This commit is contained in:
parent
8c640b179e
commit
11eb1eb7d8
7 changed files with 24 additions and 23 deletions
|
|
@ -13,6 +13,9 @@ Diaspora::Application.routes.draw do
|
||||||
resources :participations, :only => [:create, :destroy, :index]
|
resources :participations, :only => [:create, :destroy, :index]
|
||||||
resources :comments, :only => [:new, :create, :destroy, :index]
|
resources :comments, :only => [:new, :create, :destroy, :index]
|
||||||
end
|
end
|
||||||
|
|
||||||
|
match "/framer" => redirect("/posts/new")
|
||||||
|
|
||||||
get 'p/:id' => 'posts#show', :as => 'short_post'
|
get 'p/:id' => 'posts#show', :as => 'short_post'
|
||||||
# roll up likes into a nested resource above
|
# roll up likes into a nested resource above
|
||||||
resources :comments, :only => [:create, :destroy] do
|
resources :comments, :only => [:create, :destroy] do
|
||||||
|
|
@ -32,7 +35,6 @@ Diaspora::Application.routes.draw do
|
||||||
get "commented" => "streams#commented", :as => "commented_stream"
|
get "commented" => "streams#commented", :as => "commented_stream"
|
||||||
get "aspects" => "streams#aspects", :as => "aspects_stream"
|
get "aspects" => "streams#aspects", :as => "aspects_stream"
|
||||||
|
|
||||||
|
|
||||||
resources :aspects do
|
resources :aspects do
|
||||||
put :toggle_contact_visibility
|
put :toggle_contact_visibility
|
||||||
end
|
end
|
||||||
|
|
|
||||||
|
|
@ -39,7 +39,3 @@ When /^I should see "([^"]*)" aspect unselected$/ do |aspect_name|
|
||||||
page.has_css?("li[data-aspect_id='#{aspect.id}']:not(.active)").should be_true
|
page.has_css?("li[data-aspect_id='#{aspect.id}']:not(.active)").should be_true
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
When /^"([^"]*)" should render with the "([^"]*)" template$/ do |post_text, template_name|
|
|
||||||
within find_post_by_text(post_text) { assert_template(template_name) }
|
|
||||||
end
|
|
||||||
|
|
@ -17,3 +17,9 @@ end
|
||||||
Then /^I should have (\d+) nsfw posts$/ do |num_posts|
|
Then /^I should have (\d+) nsfw posts$/ do |num_posts|
|
||||||
all(".nsfw-shield").size.should == num_posts.to_i
|
all(".nsfw-shield").size.should == num_posts.to_i
|
||||||
end
|
end
|
||||||
|
|
||||||
|
When /^I click the show page link for "([^"]*)"$/ do |post_text|
|
||||||
|
within(find_post_by_text(post_text)) do
|
||||||
|
find("time").click
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
@ -25,18 +25,14 @@ def finalize_frame
|
||||||
click_button "done"
|
click_button "done"
|
||||||
end
|
end
|
||||||
|
|
||||||
def post_div
|
|
||||||
find(".post")
|
|
||||||
end
|
|
||||||
|
|
||||||
def within_frame_preview
|
def within_frame_preview
|
||||||
within post_div do
|
within find(".post") do
|
||||||
yield
|
yield
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
def assert_template(template_name)
|
def assert_post_renders_with(template_name)
|
||||||
post_div["data-template"].should == template_name
|
find(".post")["data-template"].should == template_name
|
||||||
end
|
end
|
||||||
|
|
||||||
When /^I trumpet$/ do
|
When /^I trumpet$/ do
|
||||||
|
|
@ -106,6 +102,6 @@ When /^I select the template "([^"]*)"$/ do |template_name|
|
||||||
select template_name, :from => 'template'
|
select template_name, :from => 'template'
|
||||||
end
|
end
|
||||||
|
|
||||||
Then /^I should see an "([^"]*)" framer preview$/ do |template_name|
|
Then /^the post should (?:still |)be rendered as a "([^"]*)"$/ do |template_name|
|
||||||
assert_template(template_name)
|
assert_post_renders_with(template_name)
|
||||||
end
|
end
|
||||||
|
|
@ -44,11 +44,11 @@ Feature: Creating a new post
|
||||||
And I upload a fixture picture with filename "button.gif"
|
And I upload a fixture picture with filename "button.gif"
|
||||||
And I start the framing process
|
And I start the framing process
|
||||||
Then I should see "This is hella customized" in the framer preview
|
Then I should see "This is hella customized" in the framer preview
|
||||||
# And I should see the image "button.gif"
|
# And I should see the image "button.gif" background
|
||||||
When I select the template "note"
|
When I select the template "note"
|
||||||
Then I should see an "note" framer preview
|
Then the post should be rendered as a "note"
|
||||||
When I finalize my frame
|
When I finalize my frame
|
||||||
And I go to "/stream"
|
And I go to "/stream"
|
||||||
Then "This is hella customized" should be post 1
|
Then "This is hella customized" should be post 1
|
||||||
And "This is hella customized" should render with the "note" template
|
When I click the show page link for "This is hella customized"
|
||||||
|
Then the post should still be rendered as a "note"
|
||||||
|
|
|
||||||
|
|
@ -24,17 +24,18 @@ app.pages.Framer = app.views.Base.extend({
|
||||||
|
|
||||||
var templateType = this.model.get("templateName")
|
var templateType = this.model.get("templateName")
|
||||||
|
|
||||||
var postView = new app.views.Post({
|
this._postView = new app.views.Post({
|
||||||
model : this.model,
|
model : this.model,
|
||||||
className : templateType + " post loaded",
|
className : templateType + " post loaded",
|
||||||
templateName : "post-viewer/content/" + templateType,
|
templateName : "post-viewer/content/" + templateType,
|
||||||
attributes : {"data-template" : templateType}
|
attributes : {"data-template" : templateType}
|
||||||
});
|
});
|
||||||
|
|
||||||
postView.feedbackView = new Backbone.View
|
this._postView.feedbackView = new Backbone.View
|
||||||
|
|
||||||
this.model.authorIsNotCurrentUser = function(){ return false }
|
this.model.authorIsNotCurrentUser = function(){ return false }
|
||||||
|
|
||||||
return postView
|
return this._postView
|
||||||
},
|
},
|
||||||
|
|
||||||
saveFrame : function(){
|
saveFrame : function(){
|
||||||
|
|
|
||||||
|
|
@ -10,7 +10,7 @@ describe("app.pages.Framer", function(){
|
||||||
});
|
});
|
||||||
|
|
||||||
it("passes the model down to the post view", function(){
|
it("passes the model down to the post view", function(){
|
||||||
expect(this.page.postView.model).toBe(app.frame)
|
expect(this.page._postView.model).toBe(app.frame)
|
||||||
});
|
});
|
||||||
|
|
||||||
describe("rendering", function(){
|
describe("rendering", function(){
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue