Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/tmobaird/railspeopledictionary


https://github.com/tmobaird/railspeopledictionary

Last synced: about 1 month ago
JSON representation

Awesome Lists containing this project

README

        

The People Dictionary


This is a simple ruby on rails application that allows users to enter people's information into the database where it will then be displayed in the table below the form.

Rails Directories and Configurations


All controller files are located under the /app/controllers/ directory. The main controller file for this application is tweets_controller.rb. All view files are located under the /app/views/tweets/ directory but the application.html.erb overall layout is located under the /app/views/layout/ directory. My model is located in the /app/models/ directory as the file tweet.rb.

Cloning and Native Deployment


If you would like to clone this repository you can with the following command:
```
git clone https://github.com/tmobaird/railsPeopleDictionary
```
From here to install the required gems, use the following comand:
```
bundle install
```
Lastly, to create and rake the databases, that are required to run this application, run the following:
```
bin/rake db:migrate RAILS_ENV=development
```
And BAM! you can now run this application using the following command:
```
rails server
```
Now your application can be found here.

Cucumber Testing


This is a simple rails application that can be utilized to write simple cucumber tests. There are three sample tests written right now, which are located within the /features/add.feature file. The steps within this file are the Cucumber, or high level steps for Cucumber Testing. They are in the form of Gherkin syntax which relies on the idea of Given, When, Then keywords for writing the steps. The code behind the high level Cucumber steps likes in the /features/step_definitions/navigation_steps.rb file. This is a ruby file that uses regular expressions to capture the gherkin syntax in the Cucumber feature file, and use this to start the actual testing process. In my code, I utilize page objects that are essentially classes that function as each page that is used throughout the UI and testing process. For example, I have a super class AbstractPage which includes the general methods and instance variables that any page could have. From here, my DictionaryPage class inherits from AbstractPage defining the more specific methods and variables that are necessary to test this application.
To run tests on this application simply use the following commands from the command line:
```
rake
```
or
```
cucumber /features/add.feature
```

Cloud 9


If you are using the cloud service Cloud 9, the following command will deploy your rails application to the address
"http://peopledictionary-yourCloud9UserName.c9.io/dictionary/index"
```
rails s -p $PORT -b $IP
```
If you've never heard of Cloud 9, you can check it out here. It is great for application development in the cloud, coming with customizations for many different framework and language configurations, and even allowing for application deployment within the cloud.