Browse code

Controller pre chat

Cinan Rakosnik authored on 01/03/2013 at 10:09:32
Showing 8 changed files
1 1
new file mode 100644
... ...
@@ -0,0 +1,3 @@
0
+# Place all the behaviors and hooks related to the matching controller here.
1
+# All this logic will automatically be available in application.js.
2
+# You can use CoffeeScript in this file: http://jashkenas.github.com/coffee-script/
0 3
new file mode 100644
... ...
@@ -0,0 +1,3 @@
0
+// Place all the styles related to the chat controller here.
1
+// They will automatically be included in application.css.
2
+// You can use Sass (SCSS) here: http://sass-lang.com/
0 3
new file mode 100644
... ...
@@ -0,0 +1,6 @@
0
+class ChatController < ApplicationController
1
+
2
+	def index
3
+
4
+	end
5
+end
0 6
new file mode 100644
... ...
@@ -0,0 +1,2 @@
0
+module ChatHelper
1
+end
0 2
new file mode 100644
... ...
@@ -0,0 +1,2 @@
0
+%h1 Chat#index
1
+%p Find me in app/views/chat/index.html.haml
0 2
\ No newline at end of file
... ...
@@ -1,8 +1,12 @@
1 1
 Xmpp::Application.routes.draw do
2
+  get "chat/index"
3
+
2 4
 	resources :sessions, only: [:new, :create, :destroy]
3 5
 
4 6
   	root :to => 'sessions#new'
5 7
 
6 8
 	match '/signin',  to: 'sessions#new'
7 9
 	match '/signout', to: 'sessions#destroy', via: :delete
10
+
11
+	match '/chat', to: 'chat#index'
8 12
 end
9 13
new file mode 100644
... ...
@@ -0,0 +1,22 @@
0
+require "spec_helper"
1
+
2
+describe "Chatting behaviour" do
3
+
4
+	subject { page }
5
+
6
+	it "should show account info" do
7
+		before { visit chat_path }
8
+
9
+		it { should have_selector('h1', text: 'Cinan Rakosnik') }
10
+		it { should have_selector('h2', text: 'frontend developer') }
11
+		it { should have_selector('h3', text: 'available') }
12
+	end
13
+
14
+	it "should show contact list" do
15
+		before { visit chat_path }
16
+
17
+		it { should have_selector('h1', 'Friends') }
18
+		it { should have_selector('h1', 'John Savage') }
19
+		it { should have_selector('h1', 'Adam Wolsky') }
20
+	end
21
+end
0 22
\ No newline at end of file
1 23
new file mode 100644
... ...
@@ -0,0 +1,4 @@
0
+require 'test_helper'
1
+
2
+class ChatHelperTest < ActionView::TestCase
3
+end