diff --git a/config/routes.rb b/config/routes.rb index f6e8771eb3484c2a72a0641da873a62a2df9e122..d6063f3d6660fc3f526c0c700fb48e60d717617b 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -13,6 +13,9 @@ Diaspora::Application.routes.draw do resources :participations, :only => [:create, :destroy, :index] resources :comments, :only => [:new, :create, :destroy, :index] end + + match "/framer" => redirect("/posts/new") + get 'p/:id' => 'posts#show', :as => 'short_post' # roll up likes into a nested resource above resources :comments, :only => [:create, :destroy] do @@ -32,7 +35,6 @@ Diaspora::Application.routes.draw do get "commented" => "streams#commented", :as => "commented_stream" get "aspects" => "streams#aspects", :as => "aspects_stream" - resources :aspects do put :toggle_contact_visibility end diff --git a/features/step_definitions/aspects_steps.rb b/features/step_definitions/aspects_steps.rb index fca442f408565d9c41659844fab0e75d4a98bf62..58770a5558dfab760ef5eda50904b2c0e621d8de 100644 --- a/features/step_definitions/aspects_steps.rb +++ b/features/step_definitions/aspects_steps.rb @@ -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 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 \ No newline at end of file diff --git a/features/step_definitions/stream_steps.rb b/features/step_definitions/stream_steps.rb index d508ebc58ccd9d773a6c5fec4100a95ed5a4259e..ec173268077e04636cf7d53dda8be14ddbc51264 100644 --- a/features/step_definitions/stream_steps.rb +++ b/features/step_definitions/stream_steps.rb @@ -16,4 +16,10 @@ end Then /^I should have (\d+) nsfw posts$/ do |num_posts| all(".nsfw-shield").size.should == num_posts.to_i +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 \ No newline at end of file diff --git a/features/step_definitions/trumpeter_steps.rb b/features/step_definitions/trumpeter_steps.rb index fc717ecf45f724fc661a810a36753603524c5055..b40f2beac82d14e07e27cb45567aeac7c3b6ebd0 100644 --- a/features/step_definitions/trumpeter_steps.rb +++ b/features/step_definitions/trumpeter_steps.rb @@ -25,18 +25,14 @@ def finalize_frame click_button "done" end -def post_div - find(".post") -end - def within_frame_preview - within post_div do + within find(".post") do yield end end -def assert_template(template_name) - post_div["data-template"].should == template_name +def assert_post_renders_with(template_name) + find(".post")["data-template"].should == template_name end When /^I trumpet$/ do @@ -106,6 +102,6 @@ When /^I select the template "([^"]*)"$/ do |template_name| select template_name, :from => 'template' end -Then /^I should see an "([^"]*)" framer preview$/ do |template_name| - assert_template(template_name) +Then /^the post should (?:still |)be rendered as a "([^"]*)"$/ do |template_name| + assert_post_renders_with(template_name) end \ No newline at end of file diff --git a/features/trumpeter.feature b/features/trumpeter.feature index 06c9f72c3d24922a280a7488f98d4c6a5fd91bab..29137f37d595290202bfacdea4dba0ba03bac374 100644 --- a/features/trumpeter.feature +++ b/features/trumpeter.feature @@ -44,11 +44,11 @@ Feature: Creating a new post And I upload a fixture picture with filename "button.gif" And I start the framing process 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" - Then I should see an "note" framer preview + Then the post should be rendered as a "note" When I finalize my frame And I go to "/stream" 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" diff --git a/public/javascripts/app/pages/framer.js b/public/javascripts/app/pages/framer.js index 7c6d57e75df0cc712bd3e9dcd9e093b64d6f1450..7492fb9632dd1d47a674ff5c7b27c6111865aac4 100644 --- a/public/javascripts/app/pages/framer.js +++ b/public/javascripts/app/pages/framer.js @@ -24,17 +24,18 @@ app.pages.Framer = app.views.Base.extend({ var templateType = this.model.get("templateName") - var postView = new app.views.Post({ + this._postView = new app.views.Post({ model : this.model, className : templateType + " post loaded", templateName : "post-viewer/content/" + templateType, attributes : {"data-template" : templateType} }); - postView.feedbackView = new Backbone.View + this._postView.feedbackView = new Backbone.View + this.model.authorIsNotCurrentUser = function(){ return false } - return postView + return this._postView }, saveFrame : function(){ diff --git a/spec/javascripts/app/pages/framer_spec.js b/spec/javascripts/app/pages/framer_spec.js index 4175ed2400c6e2e89664fbf3e75ee0639849368c..951d3a92c356fe12d15cd370eea66b6c9e210b8b 100644 --- a/spec/javascripts/app/pages/framer_spec.js +++ b/spec/javascripts/app/pages/framer_spec.js @@ -10,7 +10,7 @@ describe("app.pages.Framer", 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(){ @@ -24,4 +24,4 @@ describe("app.pages.Framer", function(){ expect(app.frame.save).toHaveBeenCalled(); }); }); -}); \ No newline at end of file +});